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/unit/controller | |
parent | 052178a79f9099d1ce3c36e56334cdc15911ef09 (diff) |
fix tests
Diffstat (limited to 'tests/unit/controller')
-rw-r--r-- | tests/unit/controller/AdminControllerTest.php | 16 |
1 files changed, 15 insertions, 1 deletions
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(); + } + + } |