Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions tests/phpunit/tests/http/wpGetHttpHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public function test_wp_get_http_headers_valid_url() {

/**
* Test with an invalid URL
*
* @group external-http
*/
public function test_wp_get_http_headers_invalid_url() {
$result = wp_get_http_headers( 'not_an_url' );
Expand All @@ -36,8 +34,6 @@ public function test_wp_get_http_headers_invalid_url() {

/**
* Test to see if the deprecated argument is working
*
* @group external-http
*/
public function test_wp_get_http_headers_deprecated_argument() {
$this->setExpectedDeprecated( 'wp_get_http_headers' );
Expand All @@ -58,6 +54,6 @@ public function mock_http_request( $response, $parsed_args, $url ) {
return array( 'headers' => true );
}

return $response;
return new WP_Error( 'http_request_failed', 'A valid URL was not provided.' );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mock's @return false|array|WP_Error and its $response parameter are now dead, it can never return false and never reads $response.

Does that make sense?

}
}
Loading