Changeset 46998
- Timestamp:
- 12/19/2019 08:27:16 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/external-http/basic.php
r46996 r46998 6 6 7 7 function test_readme() { 8 // This test is designed to only run on trunk/master 8 // This test is designed to only run on trunk/master. 9 9 $this->skipOnAutomatedBranches(); 10 10 … … 13 13 preg_match( '#Recommendations.*PHP</a> version <strong>([0-9.]*)#s', $readme, $matches ); 14 14 15 $response = wp_remote_get( 'https:// secure.php.net/supported-versions.php' );15 $response = wp_remote_get( 'https://www.php.net/supported-versions.php' ); 16 16 17 17 $this->skipTestOnTimeout( $response ); 18 18 19 19 $response_code = wp_remote_retrieve_response_code( $response ); 20 $response_body = wp_remote_retrieve_body( $response ); 21 20 22 if ( 200 !== $response_code ) { 21 $this->fail( sprintf( 'Could not contact PHP.net to check versions. Response code: %s', $response_code ) ); 23 $error_message = sprintf( 24 'Could not contact PHP.net to check versions. Response code: %s. Response body: %s', 25 $response_code, 26 $response_body 27 ); 28 29 if ( 503 === $response_code ) { 30 $this->markTestSkipped( $error_message ); 31 } 32 33 $this->fail( $error_message ); 22 34 } 23 35 24 $php = wp_remote_retrieve_body( $response ); 25 26 preg_match_all( '#<tr class="stable">\s*<td>\s*<a [^>]*>\s*([0-9.]*)#s', $php, $phpmatches ); 36 preg_match_all( '#<tr class="stable">\s*<td>\s*<a [^>]*>\s*([0-9.]*)#s', $response_body, $phpmatches ); 27 37 28 38 $this->assertContains( $matches[1], $phpmatches[1], "readme.html's Recommended PHP version is too old. Remember to update the WordPress.org Requirements page, too." ); … … 35 45 36 46 $response_code = wp_remote_retrieve_response_code( $response ); 47 $response_body = wp_remote_retrieve_body( $response ); 48 37 49 if ( 200 !== $response_code ) { 38 $this->fail( sprintf( 'Could not contact dev.MySQL.com to check versions. Response code: %s', $response_code ) ); 50 $error_message = sprintf( 51 'Could not contact dev.MySQL.com to check versions. Response code: %s. Response body: %s', 52 $response_code, 53 $response_body 54 ); 55 56 if ( 503 === $response_code ) { 57 $this->markTestSkipped( $error_message ); 58 } 59 60 $this->fail( $error_message ); 39 61 } 40 62 41 $mysql = wp_remote_retrieve_body( $response ); 42 43 preg_match( '#(\d{4}-\d{2}-\d{2}), General Availability#', $mysql, $mysqlmatches ); 63 preg_match( '#(\d{4}-\d{2}-\d{2}), General Availability#', $response_body, $mysqlmatches ); 44 64 45 65 // Per https://www.mysql.com/support/, Oracle actively supports MySQL releases for 5 years from GA release
Note: See TracChangeset
for help on using the changeset viewer.