@@ 86-92 (lines=7) @@ | ||
83 | ]; |
|
84 | } |
|
85 | ||
86 | public function testSetViewWithForbiddenView() { |
|
87 | $actual = $this->controller->setConfig('view','someForbiddenView'); |
|
88 | ||
89 | $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual); |
|
90 | $this->assertEquals([], $actual->getData()); |
|
91 | $this->assertEquals(422, $actual->getStatus()); |
|
92 | } |
|
93 | ||
94 | public function testSetViewWithConfigException() { |
|
95 | $this->config->expects($this->once()) |
|
@@ 155-161 (lines=7) @@ | ||
152 | ]; |
|
153 | } |
|
154 | ||
155 | public function testSetPopoverWithForbiddenValue() { |
|
156 | $actual = $this->controller->setConfig('skipPopover','someForbiddenValue'); |
|
157 | ||
158 | $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual); |
|
159 | $this->assertEquals([], $actual->getData()); |
|
160 | $this->assertEquals(422, $actual->getStatus()); |
|
161 | } |
|
162 | ||
163 | public function testSetPopoverWithConfigException() { |
|
164 | $this->config->expects($this->once()) |
|
@@ 253-259 (lines=7) @@ | ||
250 | $this->assertEquals(500, $actual->getStatus()); |
|
251 | } |
|
252 | ||
253 | public function testGetNotExistingConfig() { |
|
254 | $actual = $this->controller->getConfig('foo'); |
|
255 | ||
256 | $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual); |
|
257 | $this->assertEquals([], $actual->getData()); |
|
258 | $this->assertEquals(400, $actual->getStatus()); |
|
259 | } |
|
260 | ||
261 | public function testSetNotExistingConfig() { |
|
262 | $actual = $this->controller->setConfig('foo', 'bar'); |
|
@@ 261-267 (lines=7) @@ | ||
258 | $this->assertEquals(400, $actual->getStatus()); |
|
259 | } |
|
260 | ||
261 | public function testSetNotExistingConfig() { |
|
262 | $actual = $this->controller->setConfig('foo', 'bar'); |
|
263 | ||
264 | $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual); |
|
265 | $this->assertEquals([], $actual->getData()); |
|
266 | $this->assertEquals(400, $actual->getStatus()); |
|
267 | } |
|
268 | } |
|
269 |