From 1c4a36c52b821f54db313ee3f1919d96496952cd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 16 Apr 2024 23:07:32 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/http/functions.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/tests/http/functions.php b/tests/phpunit/tests/http/functions.php index 10d0844b04..5ec79405d8 100644 --- a/tests/phpunit/tests/http/functions.php +++ b/tests/phpunit/tests/http/functions.php @@ -27,8 +27,8 @@ class Tests_HTTP_Functions extends WP_UnitTestCase { $headers = wp_remote_retrieve_headers( $response ); $this->assertInternalType( 'array', $headers, "Reply wasn't array." ); - $this->assertSame( 'image/png', $headers['Content-Type'] ); - $this->assertSame( '153204', $headers['Content-Length'] ); + $this->assertSame( 'image/png', $headers['content-type'] ); + $this->assertSame( '153204', $headers['content-length'] ); $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. $this->assertInternalType( 'array', $headers, "Reply wasn't array." ); - $this->assertSame( 'image/png', $headers['Content-Type'] ); - $this->assertSame( '153204', $headers['Content-Length'] ); + $this->assertSame( 'image/png', $headers['content-type'] ); + $this->assertSame( '153204', $headers['content-length'] ); $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. $this->assertInternalType( 'array', $headers, "Reply wasn't array." ); - $this->assertSame( 'image/png', $headers['Content-Type'] ); - $this->assertSame( '153204', $headers['Content-Length'] ); + $this->assertSame( 'image/png', $headers['content-type'] ); + $this->assertSame( '153204', $headers['content-length'] ); $this->assertSame( 200, wp_remote_retrieve_response_code( $response ) ); }