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
This commit is contained in:
Sergey Biryukov 2022-12-10 13:31:55 +00:00
parent 0c4bd8cfc3
commit 1b42990b0c

View File

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