Make WordPress Core

Opened 6 months ago

Last modified 5 months ago

#65134 new enhancement

Unit Tests: Add tests for got_mod_rewrite()

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

Description

The function got_mod_rewrite() in src/wp-admin/includes/misc.php currently lacks unit tests. This ticket covers the addition of comprehensive unit tests for this function, ensuring it correctly detects Apache mod_rewrite support and respects the 'got_rewrite' filter.

Change History (2)

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


6 months ago
#1

  • Keywords has-patch has-unit-tests added

Reference: https://core.trac.wordpress.org/ticket/65134

This PR adds comprehensive unit tests for the got_mod_rewrite() function in src/wp-admin/includes/misc.php.
The tests cover:

  • Default behaviour based on Apache module detection.
  • Overriding behaviour using the got_rewrite filter.

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

## Use of AI Tools
AI assistance: Yes
Tool(s): Junie (JetBrains)
Model(s): gemini-3-flash-preview
Used for: Identifying untested functions, generating the test skeleton, and implementing the dataProvider logic. All code was reviewed and verified against WordPress core testing patterns.

#2 @desrosj
5 months 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.