Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 376-393 (lines=18) @@
373
	 *
374
	 * @return array Test results.
375
	 */
376
	protected function test__outbound_http() {
377
		$name    = __FUNCTION__;
378
		$request = wp_remote_get( preg_replace( '/^https:/', 'http:', JETPACK__API_BASE ) . 'test/1/' );
379
		$code    = wp_remote_retrieve_response_code( $request );
380
381
		if ( 200 === (int) $code ) {
382
			$result = self::passing_test( array( 'name' => $name ) );
383
		} else {
384
			$result = self::failing_test(
385
				array(
386
					'name'              => $name,
387
					'short_description' => $this->helper_enable_outbound_requests( 'HTTP' ),
388
				)
389
			);
390
		}
391
392
		return $result;
393
	}
394
395
	/**
396
	 * Test that the server is able to send an outbound https communication.
@@ 400-417 (lines=18) @@
397
	 *
398
	 * @return array Test results.
399
	 */
400
	protected function test__outbound_https() {
401
		$name    = __FUNCTION__;
402
		$request = wp_remote_get( preg_replace( '/^http:/', 'https:', JETPACK__API_BASE ) . 'test/1/' );
403
		$code    = wp_remote_retrieve_response_code( $request );
404
405
		if ( 200 === (int) $code ) {
406
			$result = self::passing_test( array( 'name' => $name ) );
407
		} else {
408
			$result = self::failing_test(
409
				array(
410
					'name'              => $name,
411
					'short_description' => $this->helper_enable_outbound_requests( 'HTTPS' ),
412
				)
413
			);
414
		}
415
416
		return $result;
417
	}
418
419
	/**
420
	 * Check for an IDC.