From 2369c82c15e3af54b323ca96ad34ffd3cd84a9cf Mon Sep 17 00:00:00 2001 From: Khokan Sardar Date: Wed, 24 Jun 2026 08:51:46 +0530 Subject: [PATCH] Tests: Move test_http_response_code_constants to getStatusHeaderDesc.php. The test_http_response_code_constants() test exercises get_status_header_desc() but lived in the HTTP API test file. Move it alongside the other tests for that function so all tests for get_status_header_desc() are in one place. The class-level @covers ::get_status_header_desc annotation on Tests_Functions_GetStatusHeaderDesc already covers the moved method, so the redundant method-level @covers tag is dropped. Fixes #65527. --- .../tests/functions/getStatusHeaderDesc.php | 15 +++++++++++++++ tests/phpunit/tests/http/http.php | 17 ----------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/tests/phpunit/tests/functions/getStatusHeaderDesc.php b/tests/phpunit/tests/functions/getStatusHeaderDesc.php index 1bcc6b4864669..54db712d79b07 100644 --- a/tests/phpunit/tests/functions/getStatusHeaderDesc.php +++ b/tests/phpunit/tests/functions/getStatusHeaderDesc.php @@ -41,4 +41,19 @@ public function data_get_status_header_desc() { array( 'random', '' ), ); } + + /** + * @ticket 35426 + */ + public function test_http_response_code_constants() { + global $wp_header_to_desc; + + $ref = new ReflectionClass( 'WP_Http' ); + $constants = $ref->getConstants(); + + // This primes the `$wp_header_to_desc` global: + get_status_header_desc( 200 ); + + $this->assertSame( array_keys( $wp_header_to_desc ), array_values( $constants ) ); + } } diff --git a/tests/phpunit/tests/http/http.php b/tests/phpunit/tests/http/http.php index 651064dc5674c..caba0c2e8db73 100644 --- a/tests/phpunit/tests/http/http.php +++ b/tests/phpunit/tests/http/http.php @@ -277,23 +277,6 @@ public function data_wp_parse_url_with_component() { ); } - /** - * @ticket 35426 - * - * @covers ::get_status_header_desc - */ - public function test_http_response_code_constants() { - global $wp_header_to_desc; - - $ref = new ReflectionClass( 'WP_Http' ); - $constants = $ref->getConstants(); - - // This primes the `$wp_header_to_desc` global: - get_status_header_desc( 200 ); - - $this->assertSame( array_keys( $wp_header_to_desc ), array_values( $constants ) ); - } - /** * @ticket 37768 *