Make WordPress Core

Opened 7 weeks ago

Last modified 5 weeks ago

#65134 new enhancement

Unit Tests: Add tests for got_mod_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_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.


7 weeks 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 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.