Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#65653 new enhancement

Tests: Add PHPUnit tests for wp_get_update_php_url()

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

Description

The wp_get_update_php_url() function in wp-includes/functions.php returns the URL to learn more about updating the PHP version. It allows overrides via the WP_UPDATE_PHP_URL environment variable or the wp_update_php_url filter.

This patch introduces a new test class Tests_Functions_WpGetUpdatePhpUrl to provide coverage for:

  • The default URL return value.
  • Overriding the URL via the WP_UPDATE_PHP_URL environment variable.
  • Overriding the URL via the wp_update_php_url filter.
  • Ensuring the function falls back to the default URL if an empty string is provided via filter or environment variable.

Change History (2)

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


4 weeks ago
#1

  • Keywords has-patch has-unit-tests added

This PR introduces dedicated unit tests for the wp_get_update_php_url() function in wp-includes/functions.php.
The tests verify:

•The default support URL return value.
•The ability to override the URL using the WP_UPDATE_PHP_URL environment variable.
•The ability to override the URL using the wp_update_php_url filter.
•The function's robustness in falling back to the default URL if a filter or environment variable provides an empty or invalid value.

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

AI Disclosure:
•AI assistance: Yes
•Tool(s): Junie (JetBrains)
•Model(s): gemini-3-flash-preview
•Used for: Code analysis, test implementation, and workflow management.

#2 @wildworks
4 weeks ago

  • Milestone 7.1Awaiting Review

Since 7.1 Beta 1 has already been released and these functions were not newly introduced with the 7.1 release, I'd like to remove the milestone.

Note: See TracTickets for help on using tickets.