diff --git a/tests/phpunit/tests/http/functions.php b/tests/phpunit/tests/http/functions.php index 5d58abaa89..79e0727460 100644 --- a/tests/phpunit/tests/http/functions.php +++ b/tests/phpunit/tests/http/functions.php @@ -19,20 +19,13 @@ class Tests_HTTP_Functions extends WP_UnitTestCase { $response = wp_remote_head( $url ); $headers = wp_remote_retrieve_headers( $response ); + $this->assertInternalType( 'array', $response ); + $this->assertEquals( 'image/jpeg', $headers['content-type'] ); $this->assertEquals( '40148', $headers['content-length'] ); $this->assertEquals( '200', wp_remote_retrieve_response_code( $response ) ); } - /** - * @depends test_head_request - */ - function test_returns_array() { - $url = 'https://asdftestblog1.files.wordpress.com/2007/09/2007-06-30-dsc_4700-1.jpg'; - $response = wp_remote_head( $url ); - $this->assertInternalType( 'array', $response ); - } - function test_head_redirect() { // this url will 301 redirect $url = 'https://asdftestblog1.wordpress.com/files/2007/09/2007-06-30-dsc_4700-1.jpg'; @@ -53,6 +46,8 @@ class Tests_HTTP_Functions extends WP_UnitTestCase { $response = wp_remote_get( $url ); $headers = wp_remote_retrieve_headers( $response ); + $this->assertInternalType( 'array', $response ); + // should return the same headers as a head request $this->assertEquals( 'image/jpeg', $headers['content-type'] ); $this->assertEquals( '40148', $headers['content-length'] );