Opened 5 weeks ago
Last modified 5 weeks ago
#65194 new enhancement
Tests: Add unit tests for update_home_siteurl()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch has-unit-tests |
| Focuses: | tests | Cc: |
Description
This ticket adds unit tests for the update_home_siteurl() function in wp-admin/includes/misc.php. The tests will verify that rewrite rules are correctly flushed (or the rewrite_rules option is deleted in multisite) when site URLs change, while respecting the installation state.
Change History (2)
This ticket was mentioned in PR #11754 on WordPress/wordpress-develop by @pbearne.
5 weeks ago
#1
- Keywords has-patch has-unit-tests added
Note: See
TracTickets for help on using
tickets.
Description:
This PR adds unit tests for the
update_home_siteurl()function inwp-admin/includes/misc.php. These tests ensure that WordPress rewrite rules are correctly flushed (or the option is deleted in switched multisite contexts) whenever the site URL or home URL options are updated, while correctly respecting the installation state.The tests cover:
wp_installing()is true.flush_rewrite_rules()is called on single site installations.flush_rewrite_rules()is called on multisite when not in a switched state.rewrite_rulesoption is explicitly deleted when in a switched state on multisite.Trac ticket: https://core.trac.wordpress.org/ticket/65194
AI Disclosure: