Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 276-293 (lines=18) @@
273
	 *
274
	 * @return array Test results.
275
	 */
276
	protected function test__outbound_http() {
277
		$name    = __FUNCTION__;
278
		$request = wp_remote_get( preg_replace( '/^https:/', 'http:', JETPACK__API_BASE ) . 'test/1/' );
279
		$code    = wp_remote_retrieve_response_code( $request );
280
281
		if ( 200 === intval( $code ) ) {
282
			$result = self::passing_test( array( 'name' => $name ) );
283
		} else {
284
			$result = self::failing_test(
285
				array(
286
					'name'              => $name,
287
					'short_description' => $this->helper_enable_outbound_requests( 'HTTP' ),
288
				)
289
			);
290
		}
291
292
		return $result;
293
	}
294
295
	/**
296
	 * Test that the server is able to send an outbound https communication.
@@ 300-317 (lines=18) @@
297
	 *
298
	 * @return array Test results.
299
	 */
300
	protected function test__outbound_https() {
301
		$name    = __FUNCTION__;
302
		$request = wp_remote_get( preg_replace( '/^http:/', 'https:', JETPACK__API_BASE ) . 'test/1/' );
303
		$code    = wp_remote_retrieve_response_code( $request );
304
305
		if ( 200 === intval( $code ) ) {
306
			$result = self::passing_test( array( 'name' => $name ) );
307
		} else {
308
			$result = self::failing_test(
309
				array(
310
					'name'              => $name,
311
					'short_description' => $this->helper_enable_outbound_requests( 'HTTPS' ),
312
				)
313
			);
314
		}
315
316
		return $result;
317
	}
318
319
	/**
320
	 * Check for an IDC.