Code Duplication    Length = 7-7 lines in 4 locations

tests/php/controller/settingscontrollerTest.php 4 locations

@@ 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())
@@ 304-310 (lines=7) @@
301
		$this->assertEquals(500, $actual->getStatus());
302
	}
303
304
	public function testGetNotExistingConfig() {
305
		$actual = $this->controller->getConfig('foo');
306
		
307
		$this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual);
308
		$this->assertEquals([], $actual->getData());
309
		$this->assertEquals(400, $actual->getStatus());
310
	}
311
312
	public function testSetNotExistingConfig() {
313
		$actual = $this->controller->setConfig('foo', 'bar');
@@ 312-318 (lines=7) @@
309
		$this->assertEquals(400, $actual->getStatus());
310
	}
311
312
	public function testSetNotExistingConfig() {
313
		$actual = $this->controller->setConfig('foo', 'bar');
314
315
		$this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual);
316
		$this->assertEquals([], $actual->getData());
317
		$this->assertEquals(400, $actual->getStatus());
318
	}
319
}
320