diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-20 12:14:42 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-04-20 12:14:42 +0200 |
commit | b9f3136f3a7564b983aef6564f9c7488d5b2b25b (patch) | |
tree | a50cc5851cf399df4ba594eacac53f3533c6a2ea /tests/unit/controller/ItemControllerTest.php | |
parent | e56498784f6691d5ceba84ed070f5b6f0d27aafa (diff) |
get rid of unneeded settings core class and inject it from the core container
Diffstat (limited to 'tests/unit/controller/ItemControllerTest.php')
-rw-r--r-- | tests/unit/controller/ItemControllerTest.php | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/unit/controller/ItemControllerTest.php b/tests/unit/controller/ItemControllerTest.php index c28eac9fa..6bc5595d8 100644 --- a/tests/unit/controller/ItemControllerTest.php +++ b/tests/unit/controller/ItemControllerTest.php @@ -44,7 +44,7 @@ class ItemControllerTest extends ControllerTestUtility { $this->appName = 'news'; $this->user = 'jackob'; $this->settings = $this->getMockBuilder( - '\OCA\News\Core\Settings') + '\OCP\IConfig') ->disableOriginalConstructor() ->getMock(); $this->itemBusinessLayer = @@ -57,8 +57,8 @@ class ItemControllerTest extends ControllerTestUtility { ->getMock(); $this->request = $this->getRequest(); $this->controller = new ItemController($this->appName, $this->request, - $this->feedBusinessLayer, $this->itemBusinessLayer, $this->user, - $this->settings); + $this->feedBusinessLayer, $this->itemBusinessLayer, $this->settings, + $this->user); $this->newestItemId = 12312; } @@ -70,8 +70,8 @@ class ItemControllerTest extends ControllerTestUtility { $request = $this->getRequest($post); return new ItemController($this->appName, $request, - $this->feedBusinessLayer, $this->itemBusinessLayer, $this->user, - $this->settings); + $this->feedBusinessLayer, $this->itemBusinessLayer, $this->settings, + $this->user); } @@ -297,15 +297,21 @@ class ItemControllerTest extends ControllerTestUtility { private function itemsApiExpects($id, $type){ $this->settings->expects($this->once()) ->method('getUserValue') - ->with($this->equalTo('showAll')) + ->with($this->equalTo($this->user), + $this->equalTo($this->appName), + $this->equalTo('showAll')) ->will($this->returnValue('1')); $this->settings->expects($this->at(1)) ->method('setUserValue') - ->with($this->equalTo('lastViewedFeedId'), + ->with($this->equalTo($this->user), + $this->equalTo($this->appName), + $this->equalTo('lastViewedFeedId'), $this->equalTo($id)); $this->settings->expects($this->at(2)) ->method('setUserValue') - ->with($this->equalTo('lastViewedFeedType'), + ->with($this->equalTo($this->user), + $this->equalTo($this->appName), + $this->equalTo('lastViewedFeedType'), $this->equalTo($type)); } @@ -434,7 +440,9 @@ class ItemControllerTest extends ControllerTestUtility { $this->settings->expects($this->once()) ->method('getUserValue') - ->with($this->equalTo('showAll')) + ->with($this->equalTo($this->user), + $this->equalTo($this->appName), + $this->equalTo('showAll')) ->will($this->returnValue('1')); $this->feedBusinessLayer->expects($this->once()) @@ -479,7 +487,9 @@ class ItemControllerTest extends ControllerTestUtility { $this->settings->expects($this->once()) ->method('getUserValue') - ->with($this->equalTo('showAll')) + ->with($this->equalTo($this->user), + $this->equalTo($this->appName), + $this->equalTo('showAll')) ->will($this->returnValue('1')); $this->itemBusinessLayer->expects($this->once()) |