HTTP API: Remove an unnecessary duplicate HTTP request in the HTTP tests.

See #30017


git-svn-id: https://develop.svn.wordpress.org/trunk@38758 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2016-10-08 01:02:40 +00:00
parent 8f5999fe47
commit 3fad194f64

View File

@ -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'] );