Tests: Check that `readme.html` is recommending an actively supported version of MySQL.

Per the MySQL support guidelines (https://www.mysql.com/support/), Oracle provides active support for MySQL releases for 5 years from the General Availality release.

See #33758.



git-svn-id: https://develop.svn.wordpress.org/trunk@33946 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2015-09-08 03:23:29 +00:00
parent 9f2738924c
commit f921391922
1 changed files with 15 additions and 0 deletions

View File

@ -38,6 +38,21 @@ class Tests_Basic extends WP_UnitTestCase {
preg_match_all( '#<tr class="stable">\s*<td>\s*<a [^>]*>\s*([0-9.]*)#s', $php, $phpmatches );
$this->assertContains( $matches[1], $phpmatches[1], "readme.html's Recommended PHP version is too old. Remember to update the WordPress.org Requirements page, too." );
preg_match( '#Recommendations.*MySQL</a> version <strong>([0-9.]*)#s', $readme, $matches );
$response = wp_remote_get( "https://dev.mysql.com/doc/relnotes/mysql/{$matches[1]}/en/" );
if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
$this->markTestSkipped( 'Could not contact dev.MySQL.com to check versions.' );
}
$mysql = wp_remote_retrieve_body( $response );
preg_match( '#(\d{4}-\d{2}-\d{2}), General Availability#', $mysql, $mysqlmatches );
// Per https://www.mysql.com/support/, Oracle actively supports MySQL releases for 5 years from GA release
$mysql_eol = strtotime( $mysqlmatches[1] . ' +5 years' );
$this->assertLessThan( $mysql_eol, time(), "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." );
}
function test_license() {