Tests: Revert the case change for expected headers in HTTP tests for the 4.5 branch.

Prior to [37428], the headers returned by `wp_remote_retrieve_headers()` were case-sensitive.

Follow-up to [37428], [38730], [58008].

See #60865.

git-svn-id: https://develop.svn.wordpress.org/branches/4.5@58012 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2024-04-16 23:07:32 +00:00
parent 34b8b7b0ae
commit 1c4a36c52b

View File

@ -27,8 +27,8 @@ class Tests_HTTP_Functions extends WP_UnitTestCase {
$headers = wp_remote_retrieve_headers( $response ); $headers = wp_remote_retrieve_headers( $response );
$this->assertInternalType( 'array', $headers, "Reply wasn't array." ); $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
$this->assertSame( 'image/png', $headers['Content-Type'] ); $this->assertSame( 'image/png', $headers['content-type'] );
$this->assertSame( '153204', $headers['Content-Length'] ); $this->assertSame( '153204', $headers['content-length'] );
$this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
} }
@ -72,8 +72,8 @@ class Tests_HTTP_Functions extends WP_UnitTestCase {
// Should return the same headers as a HEAD request. // Should return the same headers as a HEAD request.
$this->assertInternalType( 'array', $headers, "Reply wasn't array." ); $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
$this->assertSame( 'image/png', $headers['Content-Type'] ); $this->assertSame( 'image/png', $headers['content-type'] );
$this->assertSame( '153204', $headers['Content-Length'] ); $this->assertSame( '153204', $headers['content-length'] );
$this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
} }
@ -94,8 +94,8 @@ class Tests_HTTP_Functions extends WP_UnitTestCase {
// Should return the same headers as a HEAD request. // Should return the same headers as a HEAD request.
$this->assertInternalType( 'array', $headers, "Reply wasn't array." ); $this->assertInternalType( 'array', $headers, "Reply wasn't array." );
$this->assertSame( 'image/png', $headers['Content-Type'] ); $this->assertSame( 'image/png', $headers['content-type'] );
$this->assertSame( '153204', $headers['Content-Length'] ); $this->assertSame( '153204', $headers['content-length'] );
$this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) );
} }