Changeset 52424
- Timestamp:
- 12/30/2021 04:27:48 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/external-http/basic.php
r52421 r52424 20 20 $response_body = $this->get_response_body( 'https://www.php.net/supported-versions.php' ); 21 21 22 preg_match_all( '#<tr class="stable">\s*<td>\s*<a [^>]*>\s*([0-9.]*)#s', $response_body, $php matches );22 preg_match_all( '#<tr class="stable">\s*<td>\s*<a [^>]*>\s*([0-9.]*)#s', $response_body, $php_matches ); 23 23 24 24 // TODO: Enable this check once PHP 8.0 compatibility is achieved. 25 // $this->assertContains( $matches[1], $php matches[1], "readme.html's Recommended PHP version is too old. Remember to update the WordPress.org Requirements page, too." );25 // $this->assertContains( $matches[1], $php_matches[1], "readme.html's Recommended PHP version is too old. Remember to update the WordPress.org Requirements page, too." ); 26 26 } 27 27 … … 42 42 43 43 // Retrieve the date of the first GA release for the recommended branch. 44 preg_match( '#.*(\d{4}-\d{2}-\d{2}), General Availability#s', $response_body, $mysql matches );44 preg_match( '#.*(\d{4}-\d{2}-\d{2}), General Availability#s', $response_body, $mysql_matches ); 45 45 46 46 /* … … 53 53 * TODO: Reduce this back to 5 years once MySQL 8.0 compatibility is achieved. 54 54 */ 55 $mysql_eol = strtotime( $mysql matches[1] . ' +8 years' );55 $mysql_eol = strtotime( $mysql_matches[1] . ' +8 years' ); 56 56 57 57 $this->assertLessThan( $mysql_eol, time(), "readme.html's Recommended MySQL version is too old. Remember to update the WordPress.org Requirements page, too." ); 58 } 59 60 /** 61 * @covers ::wp_remote_get 62 * @covers ::wp_remote_retrieve_response_code 63 * @covers ::wp_remote_retrieve_body 64 */ 65 public function test_readme_mariadb_version() { 66 // This test is designed to only run on trunk/master. 67 $this->skipOnAutomatedBranches(); 68 69 $readme = file_get_contents( ABSPATH . 'readme.html' ); 70 71 preg_match( '#Recommendations.*MariaDB</a> version <strong>([0-9.]*)#s', $readme, $matches ); 72 $matches[1] = str_replace( '.', '', $matches[1] ); 73 74 $response_body = $this->get_response_body( "https://mariadb.com/kb/en/release-notes-mariadb-{$matches[1]}-series/" ); 75 76 // Retrieve the date of the first stable release for the recommended branch. 77 preg_match( '#.*Stable.*?(\d{2} [A-Za-z]{3} \d{4})#s', $response_body, $mariadb_matches ); 78 79 // Per https://mariadb.org/about/#maintenance-policy, MariaDB releases are supported for 5 years. 80 $mariadb_eol = strtotime( $mariadb_matches[1] . ' +5 years' ); 81 82 $this->assertLessThan( $mariadb_eol, time(), "readme.html's Recommended MariaDB version is too old. Remember to update the WordPress.org Requirements page, too." ); 58 83 } 59 84
Note: See TracChangeset
for help on using the changeset viewer.