Opened 6 weeks ago
Closed 6 weeks ago
#65203 closed enhancement (fixed)
Tests: Add unit tests for wp_check_php_version()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.1 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch has-unit-tests |
| Focuses: | tests | Cc: |
Description
This ticket adds comprehensive unit tests for the wp_check_php_version() function in wp-admin/includes/misc.php. The tests will cover API response handling, transient caching, the wp_is_php_version_acceptable filter, and future minimum version logic (e.g., forcing warnings for PHP < 8.0).
Change History (3)
This ticket was mentioned in PR #11764 on WordPress/wordpress-develop by @pbearne.
6 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
wp_check_php_version()function inwp-admin/includes/misc.php. These tests ensure that WordPress correctly checks the active PHP version against the Serve Happy API, handles API failures gracefully, manages caching via site transients, and correctly enforces minimum version requirements.The tests cover:
false).wp_is_php_version_acceptablefilter.Trac ticket: https://core.trac.wordpress.org/ticket/65203
AI Disclosure: