Make WordPress Core

Opened 31 hours ago

Last modified 16 hours ago

#65527 assigned defect (bug)

move the tst test_http_response_code_constants from http.php to getStatusHeaderDesc.php

Reported by: pbearne's profile pbearne Owned by: pbearne's profile pbearne
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: tests Cc:

Description

Let's get all tests into the same file

Change History (1)

This ticket was mentioned in PR #12305 on WordPress/wordpress-develop by @khokansardar.


16 hours ago
#1

  • Keywords has-patch has-unit-tests added

Moves test_http_response_code_constants() from the HTTP API test file into the test class for get_status_header_desc(), so all tests for that function live in one place.

What the problem was:

  • test_http_response_code_constants() exercises get_status_header_desc() but was located in tests/phpunit/tests/http/http.php (Tests_HTTP_HTTP).

What the fix does:

  • Moves the test method into Tests_Functions_GetStatusHeaderDesc (tests/phpunit/tests/functions/getStatusHeaderDesc.php).
  • Drops the redundant method-level @covers ::get_status_header_desc, as the class-level docblock already declares it.

Approach and why:

  • Test body is unchanged; this only relocates it to the canonical file for the function under test, improving discoverability and grouping.

Trac ticket: https://core.trac.wordpress.org/ticket/65527

## Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.8
Used for: Ticket analysis and tests. All changes were reviewed, validated against the codebase, and are taken responsibility for by me.

Note: See TracTickets for help on using tickets.