Make WordPress Core

Changeset 33946


Ignore:
Timestamp:
09/08/2015 03:23:29 AM (9 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/basic.php

    r33944 r33946  
    3939
    4040        $this->assertContains( $matches[1], $phpmatches[1], "readme.html's Recommended PHP version is too old. Remember to update the WordPress.org Requirements page, too." );
     41
     42        preg_match( '#Recommendations.*MySQL</a> version <strong>([0-9.]*)#s', $readme, $matches );
     43
     44        $response = wp_remote_get( "https://dev.mysql.com/doc/relnotes/mysql/{$matches[1]}/en/" );
     45        if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
     46            $this->markTestSkipped( 'Could not contact dev.MySQL.com to check versions.' );
     47        }
     48        $mysql = wp_remote_retrieve_body( $response );
     49
     50        preg_match( '#(\d{4}-\d{2}-\d{2}), General Availability#', $mysql, $mysqlmatches );
     51
     52        // Per https://www.mysql.com/support/, Oracle actively supports MySQL releases for 5 years from GA release
     53        $mysql_eol = strtotime( $mysqlmatches[1] . ' +5 years' );
     54
     55        $this->assertLessThan( $mysql_eol, time(), "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." );
    4156    }
    4257
Note: See TracChangeset for help on using the changeset viewer.