summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-11-19 15:54:32 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-11-19 15:54:32 +0100
commit676b8dd18742875ae07827792ed88d2b5bb3afb7 (patch)
treecd4368012b40ff6fa28cefb85e7ab49c729041ca /tests
parent62b6bd485009b5dbb85b50e634ea94aa177d8d42 (diff)
first stab at recommended sites
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/controller/PageControllerTest.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php
index 0326ef50b..8f00079a3 100644
--- a/tests/unit/controller/PageControllerTest.php
+++ b/tests/unit/controller/PageControllerTest.php
@@ -13,6 +13,8 @@
namespace OCA\News\Controller;
+use \OCA\News\Db\FeedType;
+
class PageControllerTest extends \PHPUnit_Framework_TestCase {
@@ -69,7 +71,7 @@ class PageControllerTest extends \PHPUnit_Framework_TestCase {
->disableOriginalConstructor()
->getMock();
$this->recommended = $this->getMockBuilder(
- '\OCA\News\RecommendedSites\RecommendedSites')
+ '\OCA\News\Explore\RecommendedSites')
->disableOriginalConstructor()
->getMock();
$this->controller = new PageController($this->appName, $this->request,
@@ -229,8 +231,21 @@ class PageControllerTest extends \PHPUnit_Framework_TestCase {
}
- public function testRecommended(){
+ public function testExplore(){
$in = 'test';
+ $this->settings->expects($this->at(0))
+ ->method('setUserValue')
+ ->with($this->equalTo($this->user),
+ $this->equalTo($this->appName),
+ $this->equalTo('lastViewedFeedId'),
+ $this->equalTo(0));
+
+ $this->settings->expects($this->at(1))
+ ->method('setUserValue')
+ ->with($this->equalTo($this->user),
+ $this->equalTo($this->appName),
+ $this->equalTo('lastViewedFeedType'),
+ $this->equalTo(FeedType::EXPLORE));
$this->l10n->expects($this->once())
->method('getLanguageCode')
->will($this->returnValue('de_DE'));
@@ -241,7 +256,7 @@ class PageControllerTest extends \PHPUnit_Framework_TestCase {
->will($this->returnValue($in));
- $out = $this->controller->recommended();
+ $out = $this->controller->explore();
$this->assertEquals($in, $out);
}