summaryrefslogtreecommitdiffstats
path: root/tests/unit/controller/AdminControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/controller/AdminControllerTest.php')
-rw-r--r--tests/unit/controller/AdminControllerTest.php16
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();
+ }
+
+
}