summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-04-09 16:55:06 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-04-09 22:52:27 +0200
commit339b42712104944cb1e096f9f862bedcca70a4b7 (patch)
tree998e078dabaf34b1e4e79ae72f09210fd5b0edd8 /tests
parent8588c4602811f698dec26a607bd14ea980c5ce72 (diff)
only set passed settings
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/controller/PageControllerTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unit/controller/PageControllerTest.php b/tests/unit/controller/PageControllerTest.php
index a2b9b6e16..ff229c79b 100644
--- a/tests/unit/controller/PageControllerTest.php
+++ b/tests/unit/controller/PageControllerTest.php
@@ -123,4 +123,21 @@ class PageControllerTest extends ControllerTestUtility {
$this->assertTrue($response instanceof JSONResponse);
}
+
+
+ public function testUpdateSettingsNoParameterShouldNotSetIt() {
+ $request = $this->getRequest(array('post' => array(
+ 'showAll' => true
+ )));
+ $this->controller = new PageController($this->api, $request);
+
+ $this->api->expects($this->once())
+ ->method('setUserValue')
+ ->with($this->equalTo('showAll'),
+ $this->equalTo(true));
+
+ $response = $this->controller->updateSettings();
+
+ $this->assertTrue($response instanceof JSONResponse);
+ }
} \ No newline at end of file