summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-11-25 19:52:04 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2015-11-25 19:52:22 +0100
commit79736eb1cf6abacb2b79c8b8f8ca52d1cfcc6715 (patch)
tree46831c06aa2e7577e091e4d5109371a56718a844 /tests
parent052178a79f9099d1ce3c36e56334cdc15911ef09 (diff)
fix tests
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/command/CommandTest.php4
-rw-r--r--tests/unit/controller/AdminControllerTest.php16
-rw-r--r--tests/unit/fetcher/FeedFetcherTest.php2
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;
}