From 3fad194f64d93a0b347a43cbde90cb0269c82eb3 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 8 Oct 2016 01:02:40 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/http/functions.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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'] );