Code Duplication    Length = 13-13 lines in 2 locations

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

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