summaryrefslogtreecommitdiffstats
path: root/tests/unit/controller/PageControllerTest.php
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-04-20 12:14:42 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-04-20 12:14:42 +0200
commitb9f3136f3a7564b983aef6564f9c7488d5b2b25b (patch)
treea50cc5851cf399df4ba594eacac53f3533c6a2ea /tests/unit/controller/PageControllerTest.php
parente56498784f6691d5ceba84ed070f5b6f0d27aafa (diff)
get rid of unneeded settings core class and inject it from the core container
Diffstat (limited to 'tests/unit/controller/PageControllerTest.php')
-rw-r--r--tests/unit/controller/PageControllerTest.php30
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php
index 898226361..49e155bd0 100644
--- a/tests/unit/controller/PageControllerTest.php
+++ b/tests/unit/controller/PageControllerTest.php
@@ -37,15 +37,15 @@ class PageControllerTest extends ControllerTestUtility {
*/
public function setUp(){
$this->appName = 'news';
+ $this->user = 'becka';
$this->l10n = $this->getMock('L10N', array('findLanguage'));
$this->settings = $this->getMockBuilder(
- '\OCA\News\Core\Settings')
+ '\OCP\IConfig')
->disableOriginalConstructor()
->getMock();
$this->request = $this->getRequest();
$this->controller = new PageController($this->appName, $this->request,
- $this->settings, $this->l10n);
- $this->user = 'becka';
+ $this->settings, $this->l10n, $this->user);
}
@@ -83,11 +83,15 @@ class PageControllerTest extends ControllerTestUtility {
->will($this->returnValue('de'));
$this->settings->expects($this->at(0))
->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('getUserValue')
- ->with($this->equalTo('compact'))
+ ->with($this->equalTo($this->user),
+ $this->equalTo($this->appName),
+ $this->equalTo('compact'))
->will($this->returnValue('1'));
$response = $this->controller->settings();
@@ -102,15 +106,19 @@ class PageControllerTest extends ControllerTestUtility {
'compact' => true
)));
$this->controller = new PageController($this->appName, $request,
- $this->settings, $this->l10n);
+ $this->settings, $this->l10n, $this->user);
$this->settings->expects($this->at(0))
->method('setUserValue')
- ->with($this->equalTo('showAll'),
+ ->with($this->equalTo($this->user),
+ $this->equalTo($this->appName),
+ $this->equalTo('showAll'),
$this->equalTo(true));
$this->settings->expects($this->at(1))
->method('setUserValue')
- ->with($this->equalTo('compact'),
+ ->with($this->equalTo($this->user),
+ $this->equalTo($this->appName),
+ $this->equalTo('compact'),
$this->equalTo(true));
$response = $this->controller->updateSettings();
@@ -123,11 +131,13 @@ class PageControllerTest extends ControllerTestUtility {
'showAll' => true
)));
$this->controller = new PageController($this->appName, $request,
- $this->settings, $this->l10n);
+ $this->settings, $this->l10n, $this->user);
$this->settings->expects($this->once())
->method('setUserValue')
- ->with($this->equalTo('showAll'),
+ ->with($this->equalTo($this->user),
+ $this->equalTo($this->appName),
+ $this->equalTo('showAll'),
$this->equalTo(true));
$response = $this->controller->updateSettings();