@@ -43,11 +43,15 @@ class Tests_REST_WpRestUrlDetailsController extends WP_Test_REST_Controller_Test
4343 /**
4444 * URL placeholder.
4545 *
46+ * Even though the request is being intercepted with a mocked response, it is not fully bypassing the network. The
47+ * REST API endpoint is validating the `url` parameter with `wp_http_validate_url()` which includes a call to
48+ * `gethostbyname()`. So the domain used in the placeholder URL must be valid to ensure it passes a validity check.
49+ *
4650 * @since 5.9.0
4751 *
4852 * @var string
4953 */
50- const URL_PLACEHOLDER = 'https://placeholder-site .com ' ;
54+ const URL_PLACEHOLDER = 'https://example .com ' ;
5155
5256 /**
5357 * Array of request args.
@@ -129,9 +133,9 @@ public function test_get_items() {
129133 $ this ->assertSame (
130134 array (
131135 'title ' => 'Example Website — - with encoded content. ' ,
132- 'icon ' => 'https://placeholder-site .com/favicon.ico?querystringaddedfortesting ' ,
136+ 'icon ' => 'https://example .com/favicon.ico?querystringaddedfortesting ' ,
133137 'description ' => 'Example description text here. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore. ' ,
134- 'image ' => 'https://placeholder-site .com/images/home/screen-themes.png?3 ' ,
138+ 'image ' => 'https://example .com/images/home/screen-themes.png?3 ' ,
135139 ),
136140 $ data
137141 );
@@ -444,7 +448,7 @@ static function ( $response, $url ) {
444448
445449 $ this ->assertSame ( 418 , $ data ['status ' ], 'Response "status" is not 418 ' );
446450
447- $ expected = 'Response for URL https://placeholder-site .com altered via rest_prepare_url_details filter ' ;
451+ $ expected = 'Response for URL https://example .com altered via rest_prepare_url_details filter ' ;
448452 $ this ->assertSame ( $ expected , $ data ['response ' ], 'Response "response" is not " ' . $ expected . '" ' );
449453 }
450454
0 commit comments