Code Duplication    Length = 27-27 lines in 2 locations

tests/settings/controller/CheckSetupControllerTest.php 2 locations

@@ 116-142 (lines=27) @@
113
		);
114
	}
115
116
	public function testIsInternetConnectionWorkingCorrectly() {
117
		$this->config->expects($this->once())
118
			->method('getSystemValue')
119
			->with('has_internet_connection', true)
120
			->will($this->returnValue(true));
121
122
		$client = $this->getMockBuilder('\OCP\Http\Client\IClient')
123
			->disableOriginalConstructor()->getMock();
124
		$client->expects($this->at(0))
125
			->method('get')
126
			->with('https://www.owncloud.org/', []);
127
		$client->expects($this->at(1))
128
			->method('get')
129
			->with('http://www.owncloud.org/', []);
130
131
		$this->clientService->expects($this->once())
132
			->method('newClient')
133
			->will($this->returnValue($client));
134
135
136
		$this->assertTrue(
137
			self::invokePrivate(
138
				$this->checkSetupController,
139
				'isInternetConnectionWorking'
140
			)
141
		);
142
	}
143
144
	public function testIsInternetConnectionHttpsFail() {
145
		$this->config->expects($this->once())
@@ 169-195 (lines=27) @@
166
		);
167
	}
168
169
	public function testIsInternetConnectionHttpFail() {
170
		$this->config->expects($this->once())
171
			->method('getSystemValue')
172
			->with('has_internet_connection', true)
173
			->will($this->returnValue(true));
174
175
		$client = $this->getMockBuilder('\OCP\Http\Client\IClient')
176
			->disableOriginalConstructor()->getMock();
177
		$client->expects($this->at(0))
178
			->method('get')
179
			->with('https://www.owncloud.org/', []);
180
		$client->expects($this->at(1))
181
			->method('get')
182
			->with('http://www.owncloud.org/', [])
183
			->will($this->throwException(new \Exception()));
184
185
		$this->clientService->expects($this->once())
186
			->method('newClient')
187
			->will($this->returnValue($client));
188
189
		$this->assertFalse(
190
			self::invokePrivate(
191
				$this->checkSetupController,
192
				'isInternetConnectionWorking'
193
			)
194
		);
195
	}
196
197
	public function testIsMemcacheConfiguredFalse() {
198
		$this->config->expects($this->once())