summaryrefslogtreecommitdiffstats
path: root/tests/unit/upgrade/UpgradeTest.php
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2016-07-23 21:24:54 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2016-07-23 21:24:54 +0200
commit004fcbbcc7609ca83807f2e38967ef54f469bf72 (patch)
tree49eb99b4ea92b2045793fc567f719b31ec7f9042 /tests/unit/upgrade/UpgradeTest.php
parent60abc0ed4438c9b6fda245b0dc33cb483bc2aeaf (diff)
Move to new directory structure
Diffstat (limited to 'tests/unit/upgrade/UpgradeTest.php')
-rw-r--r--tests/unit/upgrade/UpgradeTest.php72
1 files changed, 0 insertions, 72 deletions
diff --git a/tests/unit/upgrade/UpgradeTest.php b/tests/unit/upgrade/UpgradeTest.php
deleted file mode 100644
index a3d473b63..000000000
--- a/tests/unit/upgrade/UpgradeTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
- * Created by IntelliJ IDEA.
- * User: bernhard
- * Date: 11/26/15
- * Time: 7:40 PM
- */
-
-namespace OCA\News\Upgrade;
-
-use OCP\IConfig;
-use OCA\News\Service\ItemService;
-
-class UpgradeTest extends \PHPUnit_Framework_TestCase {
-
- /** @var Upgrade */
- private $upgrade;
-
- /** @var ItemService */
- private $service;
-
- /** @var IConfig */
- private $config;
-
- /** @var IDBConnection */
- private $db;
-
- public function setUp() {
- $this->config = $this->getMockBuilder(
- '\OCP\IConfig')
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->db = $this->getMockBuilder(
- '\OCP\IDBConnection')
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->service = $this->getMockBuilder(
- '\OCA\News\Service\ItemService')
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->upgrade = new Upgrade($this->config, $this->service,
- $this->db, 'news');
- }
-
- public function testUpgrade() {
- $this->config->expects($this->once())
- ->method('getAppValue')
- ->with($this->equalTo('news'), $this->equalTo('installed_version'))
- ->will($this->returnValue('8.9.0'));
-
- $this->service->expects($this->once())
- ->method('generateSearchIndices');
-
- $this->upgrade->upgrade();
- }
-
- public function testNoUpgrade() {
- $this->config->expects($this->once())
- ->method('getAppValue')
- ->with($this->equalTo('news'), $this->equalTo('installed_version'))
- ->will($this->returnValue('8.9.1'));
-
- $this->service->expects($this->never())
- ->method('generateSearchIndices');
-
- $this->upgrade->upgrade();
- }
-
-}