Make WordPress Core

Opened 7 weeks ago

Last modified 5 weeks ago

#65135 new enhancement

Unit Tests: Add tests for got_url_rewrite()

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

Description

The function got_url_rewrite() in src/wp-admin/includes/misc.php currently lacks unit tests. This PR adds tests to ensure it correctly identifies URL rewriting support across Apache, nginx, IIS, and Caddy, and respects the 'got_url_rewrite' filter.

Change History (2)

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


7 weeks ago
#1

  • Keywords has-patch has-unit-tests added

Reference: https://core.trac.wordpress.org/ticket/65135
This PR adds comprehensive unit tests for the got_url_rewrite() function in src/wp-admin/includes/misc.php.
The tests verify detection across different server environments:

  • Apache (via got_mod_rewrite)
  • Nginx (via $is_nginx global)
  • Caddy (via $is_caddy global)
  • Overriding via the got_url_rewrite filter.

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

## Use of AI Tools
AI assistance: Yes
Tool(s): Junie (JetBrains)
Model(s): gemini-3-flash-preview
Used for: Test structure generation, global variable mocking strategy, and dataProvider implementation.

#2 @desrosj
5 weeks ago

  • Focuses tests added

Adding the tests focus, which is used to indicate a ticket is solely focused on adding tests.

Note: See TracTickets for help on using tickets.