Site Health: Bump the recommended MySQL and MariaDB versions.

* MySQL 5.6 has reached EOL (“End of Life”) in February 2021. The recommended minimum is bumped to 5.7 for now.
* MariaDB 10.2 has reached EOL in May 2022. The recommended minimum is bumped to 10.3 for now.

This commit brings the Site Health recommendations in line with `readme.html`.

Includes:
* Adding two unit tests to ensure the SQL server versions recommended by Site Health match `readme.html`.
* Consistently declaring the recommended and required versions as the `WP_Site_Health` class properties.
* Renaming some pre-existing private properties for clarity.

Follow-up to [44986], [52319], [52358], [52420], [52424], [53431], [53433], [53435], [meta11407], [meta11866].

See #55791, #meta5999, #meta6322.

git-svn-id: https://develop.svn.wordpress.org/trunk@54069 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-09-05 15:18:13 +00:00
parent c7af86080d
commit 604abb0216
2 changed files with 61 additions and 16 deletions

View File

@@ -11,6 +11,52 @@ class Tests_Site_Health extends WP_UnitTestCase {
require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
}
/**
* @ticket 55791
* @covers ::prepare_sql_data()
* @covers ::get_test_sql_server()
*/
public function test_mysql_recommended_version_matches_readme_html() {
// This test is designed to only run on trunk.
$this->skipOnAutomatedBranches();
$wp_site_health = new WP_Site_Health();
$wp_site_health->get_test_sql_server();
$reflection = new ReflectionClass( $wp_site_health );
$reflection_property = $reflection->getProperty( 'mysql_recommended_version' );
$reflection_property->setAccessible( true );
$readme = file_get_contents( ABSPATH . 'readme.html' );
preg_match( '#Recommendations.*MySQL</a> version <strong>([0-9.]*)#s', $readme, $matches );
$this->assertSame( $matches[1], $reflection_property->getValue( $wp_site_health ) );
}
/**
* @ticket 55791
* @covers ::prepare_sql_data()
* @covers ::get_test_sql_server()
*/
public function test_mariadb_recommended_version_matches_readme_html() {
// This test is designed to only run on trunk.
$this->skipOnAutomatedBranches();
$wp_site_health = new WP_Site_Health();
$wp_site_health->get_test_sql_server();
$reflection = new ReflectionClass( $wp_site_health );
$reflection_property = $reflection->getProperty( 'mariadb_recommended_version' );
$reflection_property->setAccessible( true );
$readme = file_get_contents( ABSPATH . 'readme.html' );
preg_match( '#Recommendations.*MariaDB</a> version <strong>([0-9.]*)#s', $readme, $matches );
$this->assertSame( $matches[1], $reflection_property->getValue( $wp_site_health ) );
}
/**
* Ensure Site Health reports correctly cron job reports.
*