Code Duplication    Length = 13-13 lines in 2 locations

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

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