Code Duplication    Length = 7-7 lines in 4 locations

tests/unit/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())
@@ 202-208 (lines=7) @@
199
		$this->assertEquals(500, $actual->getStatus());
200
	}
201
202
	public function testGetNotExistingConfig() {
203
		$actual = $this->controller->getConfig('foo');
204
		
205
		$this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual);
206
		$this->assertEquals([], $actual->getData());
207
		$this->assertEquals(400, $actual->getStatus());
208
	}
209
210
	public function testSetNotExistingConfig() {
211
		$actual = $this->controller->setConfig('foo', 'bar');
@@ 210-216 (lines=7) @@
207
		$this->assertEquals(400, $actual->getStatus());
208
	}
209
210
	public function testSetNotExistingConfig() {
211
		$actual = $this->controller->setConfig('foo', 'bar');
212
213
		$this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual);
214
		$this->assertEquals([], $actual->getData());
215
		$this->assertEquals(400, $actual->getStatus());
216
	}
217
}
218