@@ 88-94 (lines=7) @@ | ||
85 | ]; |
|
86 | } |
|
87 | ||
88 | public function testSetViewWithForbiddenView() { |
|
89 | $actual = $this->controller->setConfig('view','someForbiddenView'); |
|
90 | ||
91 | $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual); |
|
92 | $this->assertEquals([], $actual->getData()); |
|
93 | $this->assertEquals(422, $actual->getStatus()); |
|
94 | } |
|
95 | ||
96 | public function testSetViewWithConfigException() { |
|
97 | $this->config->expects($this->once()) |
|
@@ 157-163 (lines=7) @@ | ||
154 | ]; |
|
155 | } |
|
156 | ||
157 | public function testSetPopoverWithForbiddenValue() { |
|
158 | $actual = $this->controller->setConfig('skipPopover','someForbiddenValue'); |
|
159 | ||
160 | $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual); |
|
161 | $this->assertEquals([], $actual->getData()); |
|
162 | $this->assertEquals(422, $actual->getStatus()); |
|
163 | } |
|
164 | ||
165 | public function testSetPopoverWithConfigException() { |
|
166 | $this->config->expects($this->once()) |
|
@@ 306-312 (lines=7) @@ | ||
303 | $this->assertEquals(500, $actual->getStatus()); |
|
304 | } |
|
305 | ||
306 | public function testGetNotExistingConfig() { |
|
307 | $actual = $this->controller->getConfig('foo'); |
|
308 | ||
309 | $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual); |
|
310 | $this->assertEquals([], $actual->getData()); |
|
311 | $this->assertEquals(400, $actual->getStatus()); |
|
312 | } |
|
313 | ||
314 | public function testSetNotExistingConfig() { |
|
315 | $actual = $this->controller->setConfig('foo', 'bar'); |
|
@@ 314-320 (lines=7) @@ | ||
311 | $this->assertEquals(400, $actual->getStatus()); |
|
312 | } |
|
313 | ||
314 | public function testSetNotExistingConfig() { |
|
315 | $actual = $this->controller->setConfig('foo', 'bar'); |
|
316 | ||
317 | $this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual); |
|
318 | $this->assertEquals([], $actual->getData()); |
|
319 | $this->assertEquals(400, $actual->getStatus()); |
|
320 | } |
|
321 | } |
|
322 |