diff --git a/tests/phpunit/tests/rest-api/rest-site-health-controller.php b/tests/phpunit/tests/rest-api/rest-site-health-controller.php index 9d67401d57d60..fce2704c09a59 100644 --- a/tests/phpunit/tests/rest-api/rest-site-health-controller.php +++ b/tests/phpunit/tests/rest-api/rest-site-health-controller.php @@ -92,11 +92,24 @@ static function () { $this->assertErrorResponse( 'rest_forbidden', $response, 403 ); } - /** - * @group external-http - */ public function test() { wp_set_current_user( self::$admin ); + add_filter( + 'pre_http_request', + static function () { + return array( + 'headers' => array(), + 'body' => '', + 'response' => array( + 'code' => 200, + 'message' => 'OK', + ), + 'cookies' => array(), + 'filename' => null, + ); + } + ); + $response = rest_do_request( '/wp-site-health/v1/tests/dotorg-communication' ); $this->assertSame( 'dotorg_communication', $response->get_data()['test'] ); }