diff --git a/tests/phpunit/tests/external-http/basic.php b/tests/phpunit/tests/external-http/basic.php index e34f4841ba..bb7415b2af 100644 --- a/tests/phpunit/tests/external-http/basic.php +++ b/tests/phpunit/tests/external-http/basic.php @@ -52,9 +52,10 @@ class Tests_External_HTTP_Basic extends WP_UnitTestCase { * * TODO: Reduce this back to 5 years once MySQL 8.0 compatibility is achieved. */ - $mysql_eol = strtotime( $mysql_matches[1] . ' +8 years' ); + $mysql_eol = gmdate( 'Y-m-d', strtotime( $mysql_matches[1] . ' +8 years' ) ); + $current_date = gmdate( 'Y-m-d' ); - $this->assertLessThan( $mysql_eol, time(), "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." ); + $this->assertLessThan( $mysql_eol, $current_date, "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." ); } /** @@ -84,9 +85,10 @@ class Tests_External_HTTP_Basic extends WP_UnitTestCase { preg_match( '#.*Stable.*?(\d{2} [A-Za-z]{3} \d{4})#s', $response_body, $mariadb_matches ); // Per https://mariadb.org/about/#maintenance-policy, MariaDB releases are supported for 5 years. - $mariadb_eol = strtotime( $mariadb_matches[1] . ' +5 years' ); + $mariadb_eol = gmdate( 'Y-m-d', strtotime( $mariadb_matches[1] . ' +5 years' ) ); + $current_date = gmdate( 'Y-m-d' ); - $this->assertLessThan( $mariadb_eol, time(), "readme.html's Recommended MariaDB version is too old. Remember to update the WordPress.org Requirements page, too." ); + $this->assertLessThan( $mariadb_eol, $current_date, "readme.html's Recommended MariaDB version is too old. Remember to update the WordPress.org Requirements page, too." ); } /**