From 1b42990b0cff38f2bf0f528e18ab525c336b2837 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 10 Dec 2022 13:31:55 +0000 Subject: [PATCH] Tests: Temporarily disable a `WP_Http` test for multiple `Location` headers. The test verifies that `WP_Http::handle_redirects()` uses the last specified URL as the redirect location if multiple `Location` headers are specified in the response. It appears that the redirection script on api.wordpress.org no longer sends the expected two `Location` headers, causing the test to fail. While the exact cause is being investigated and confirmed, this commit disables the affected test for now, so that other commits and PRs are not blocked by these failures. Follow-up to [342/tests], [874/tests], [1329/tests], [24846]. Props costdev, SergeyBiryukov. See #57306. git-svn-id: https://develop.svn.wordpress.org/trunk@54955 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/http/base.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/tests/http/base.php b/tests/phpunit/tests/http/base.php index ee42056bb3..54bb025caa 100644 --- a/tests/phpunit/tests/http/base.php +++ b/tests/phpunit/tests/http/base.php @@ -438,6 +438,9 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase { /** * Test HTTP Redirects with multiple Location headers specified. * + * This test has been disabled due to api.wordpress.org failing to + * send two Location headers. See #57306. + * * @ticket 16890 * * @covers ::wp_remote_head @@ -445,7 +448,7 @@ abstract class WP_HTTP_UnitTestCase extends WP_UnitTestCase { * @covers ::wp_remote_get * @covers ::wp_remote_retrieve_body */ - public function test_multiple_location_headers() { + public function disabled_test_multiple_location_headers() { $url = 'http://api.wordpress.org/core/tests/1.0/redirection.php?multiple-location-headers=1'; $res = wp_remote_head( $url, array( 'timeout' => 30 ) );