Make WordPress Core


Ignore:
Timestamp:
09/07/2015 05:22:03 AM (10 years ago)
Author:
pento
Message:

Readme: Update the recommended PHP version to 5.6.

This also includes a unit test to ensure we're only recommending actively supported versions of PHP in the future.

Fixes #33758.

File:
1 edited

Legend:

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

    r31622 r33937  
    2727        list( $version ) = explode( '-', $GLOBALS['wp_version'] );
    2828        $this->assertEquals( $version, trim( $matches[1] ), "readme.html's version needs to be updated to $version." );
     29
     30        preg_match( '#Recommendations.*PHP</a> version <strong>([0-9.]*)#s', $readme, $matches );
     31
     32        $response = wp_remote_get( 'https://secure.php.net/supported-versions.php' );
     33        if ( 200 != wp_remote_retrieve_response_code( $response ) ) {
     34            $this->markTestSkipped( 'Could not contact PHP.net to check versions.' );
     35        }
     36        $php = wp_remote_retrieve_body( $response );
     37
     38        preg_match_all( '#<tr class="stable">\s*<td>\s*<a [^>]*>\s*([0-9.]*)#s', $php, $phpmatches );
     39
     40        $this->assertContains( $matches[1], $phpmatches[1] );
    2941    }
    3042
Note: See TracChangeset for help on using the changeset viewer.