Make WordPress Core

Changeset 33937


Ignore:
Timestamp:
09/07/2015 05:22:03 AM (9 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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/readme.html

    r33636 r33937  
    6060<h2>Recommendations</h2>
    6161<ul>
    62     <li><a href="http://php.net/">PHP</a> version <strong>5.4</strong> or higher.</li>
     62    <li><a href="http://php.net/">PHP</a> version <strong>5.6</strong> or higher.</li>
    6363    <li><a href="http://www.mysql.com/">MySQL</a> version <strong>5.5</strong> or higher.</li>
    6464    <li>The <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">mod_rewrite</a> Apache module.</li>
  • 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.