Code Duplication    Length = 11-11 lines in 3 locations

tests/php/controller/settingscontrollerTest.php 3 locations

@@ 66-76 (lines=11) @@
63
	/**
64
	 * @dataProvider setViewWithAllowedViewDataProvider
65
	 */
66
	public function testSetViewWithAllowedView($view) {
67
		$this->config->expects($this->once())
68
			->method('setUserValue')
69
			->with('user123', $this->appName, 'currentView', $view);
70
71
		$actual = $this->controller->setConfig('view', $view);
72
73
		$this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual);
74
		$this->assertEquals([], $actual->getData());
75
		$this->assertEquals(200, $actual->getStatus());
76
	}
77
78
	public function setViewWithAllowedViewDataProvider() {
79
		return [
@@ 136-146 (lines=11) @@
133
	/**
134
	 * @dataProvider setPopoverWithAllowedValueDataProvider
135
	 */
136
	public function testSetPopoverWithAllowedValue($value) {
137
		$this->config->expects($this->once())
138
			->method('setUserValue')
139
			->with('user123', $this->appName, 'skipPopover', $value);
140
141
		$actual = $this->controller->setConfig('skipPopover', $value);
142
143
		$this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual);
144
		$this->assertEquals([], $actual->getData());
145
		$this->assertEquals(200, $actual->getStatus());
146
	}
147
148
	public function setPopoverWithAllowedValueDataProvider() {
149
		return [
@@ 202-212 (lines=11) @@
199
		$this->assertEquals(500, $actual->getStatus());
200
	}
201
202
	public function testSetFirstRun() {
203
		$this->config->expects($this->once())
204
			->method('setUserValue')
205
			->with('user123', $this->appName, 'firstRun', 'no');
206
207
		$actual = $this->controller->setConfig('firstRun', 'some_random_ignored_value');
208
209
		$this->assertInstanceOf('OCP\AppFramework\Http\JSONResponse', $actual);
210
		$this->assertEquals([], $actual->getData());
211
		$this->assertEquals(200, $actual->getStatus());
212
	}
213
214
	public function testSetFirstRunWithException() {
215
		$this->config->expects($this->once())