Code Duplication    Length = 13-13 lines in 2 locations

_inc/lib/debugger/class-jetpack-cxn-tests.php 2 locations

@@ 171-183 (lines=13) @@
168
	 *
169
	 * @return array Test results.
170
	 */
171
	protected function test__outbound_http() {
172
		$name    = __FUNCTION__;
173
		$request = wp_remote_get( preg_replace( '/^https:/', 'http:', JETPACK__API_BASE ) . 'test/1/' );
174
		$code    = wp_remote_retrieve_response_code( $request );
175
176
		if ( 200 === intval( $code ) ) {
177
			$result = self::passing_test( $name );
178
		} else {
179
			$result = self::failing_test( $name, __( 'Your server did not successfully connect to the Jetpack server using HTTP', 'jetpack' ), 'outbound_requests' );
180
		}
181
182
		return $result;
183
	}
184
185
	/**
186
	 * Test that the server is able to send an outbound https communication.
@@ 190-202 (lines=13) @@
187
	 *
188
	 * @return array Test results.
189
	 */
190
	protected function test__outbound_https() {
191
		$name    = __FUNCTION__;
192
		$request = wp_remote_get( preg_replace( '/^http:/', 'https:', JETPACK__API_BASE ) . 'test/1/' );
193
		$code    = wp_remote_retrieve_response_code( $request );
194
195
		if ( 200 === intval( $code ) ) {
196
			$result = self::passing_test( $name );
197
		} else {
198
			$result = self::failing_test( $name, __( 'Your server did not successfully connect to the Jetpack server using HTTPS', 'jetpack' ), 'outbound_requests' );
199
		}
200
201
		return $result;
202
	}
203
204
	/**
205
	 * Check for an IDC.