diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-25 19:52:04 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-11-25 19:52:22 +0100 |
commit | 79736eb1cf6abacb2b79c8b8f8ca52d1cfcc6715 (patch) | |
tree | 46831c06aa2e7577e091e4d5109371a56718a844 /tests | |
parent | 052178a79f9099d1ce3c36e56334cdc15911ef09 (diff) |
fix tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/command/CommandTest.php | 4 | ||||
-rw-r--r-- | tests/unit/controller/AdminControllerTest.php | 16 | ||||
-rw-r--r-- | tests/unit/fetcher/FeedFetcherTest.php | 2 |
3 files changed, 18 insertions, 4 deletions
diff --git a/tests/integration/command/CommandTest.php b/tests/integration/command/CommandTest.php index 4501f3b95..72d7602ff 100644 --- a/tests/integration/command/CommandTest.php +++ b/tests/integration/command/CommandTest.php @@ -17,8 +17,8 @@ class CommandTest extends \PHPUnit_Framework_TestCase { $this->corePath = __DIR__ . '/../../../../../'; } - public function testGenerateIndices() { - $command = $this->corePath . 'occ news:create-search-indices'; + public function testMigrate() { + $command = $this->corePath . 'occ news:migrate'; exec($command, $_, $success); $this->assertSame(0, $success); diff --git a/tests/unit/controller/AdminControllerTest.php b/tests/unit/controller/AdminControllerTest.php index d86c4cf98..c74b8570e 100644 --- a/tests/unit/controller/AdminControllerTest.php +++ b/tests/unit/controller/AdminControllerTest.php @@ -21,6 +21,7 @@ class AdminControllerTest extends \PHPUnit_Framework_TestCase { private $controller; private $config; private $configPath; + private $itemService; /** * Gets run before each test @@ -35,9 +36,14 @@ class AdminControllerTest extends \PHPUnit_Framework_TestCase { '\OCA\News\Config\Config') ->disableOriginalConstructor() ->getMock(); + $this->itemService = $this->getMockBuilder( + '\OCA\News\Service\ItemService') + ->disableOriginalConstructor() + ->getMock(); + $this->configPath = 'my.ini'; $this->controller = new AdminController($this->appName, $this->request, - $this->config, $this->configPath); + $this->config, $this->itemService, $this->configPath); } @@ -151,4 +157,12 @@ class AdminControllerTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($expected, $response); } + + public function testMigrate() { + $this->itemService->expects($this->once()) + ->method('generateSearchIndices'); + $this->controller->migrate(); + } + + } diff --git a/tests/unit/fetcher/FeedFetcherTest.php b/tests/unit/fetcher/FeedFetcherTest.php index 276a3e485..f6a03afa2 100644 --- a/tests/unit/fetcher/FeedFetcherTest.php +++ b/tests/unit/fetcher/FeedFetcherTest.php @@ -235,7 +235,7 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase { $item->setEnclosureLink($this->enclosureLink); } $item->generateSearchIndex(); - + return $item; } |