<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[56141] trunk: General: Increase the minimum supported version of PHP to 7.0.0.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/56141">56141</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/56141","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>johnbillion</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-07-05 17:39:55 +0000 (Wed, 05 Jul 2023)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>General: Increase the minimum supported version of PHP to 7.0.0.
This also removes the random compat library which is no longer necessary, and adjusts unit tests and CI workflows that no longer need to take PHP 5.6 into account.
Thank you for your service, PHP 5. Onwards!
Props SergeyBiryukov, mukesh27, dingo_d, audrasjb, jrf, costdev, azaozz, JavierCasares, hellofromTonya, samiamnot, spacedmonkey, masteradhoc, knutsp, garyjones, chanthaboune
Fixes <a href="https://core.trac.wordpress.org/ticket/57345">#57345</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkgithubworkflowsphpunittestsyml">trunk/.github/workflows/phpunit-tests.yml</a></li>
<li><a href="#trunkcomposerjson">trunk/composer.json</a></li>
<li><a href="#trunkphpcompatxmldist">trunk/phpcompat.xml.dist</a></li>
<li><a href="#trunksrcreadmehtml">trunk/src/readme.html</a></li>
<li><a href="#trunksrcwpincludescompatphp">trunk/src/wp-includes/compat.php</a></li>
<li><a href="#trunksrcwpincludesversionphp">trunk/src/wp-includes/version.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpMediaListTablephp">trunk/tests/phpunit/tests/admin/wpMediaListTable.php</a></li>
<li><a href="#trunktestsphpunittestsdatedateI18nphp">trunk/tests/phpunit/tests/date/dateI18n.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionswpListUtilphp">trunk/tests/phpunit/tests/functions/wpListUtil.php</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li>trunk/src/wp-includes/random_compat/</li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkgithubworkflowsphpunittestsyml"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/.github/workflows/phpunit-tests.yml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/.github/workflows/phpunit-tests.yml 2023-07-05 16:19:39 UTC (rev 56140)
+++ trunk/.github/workflows/phpunit-tests.yml 2023-07-05 17:39:55 UTC (rev 56141)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> env:
</span><span class="cx" style="display: block; padding: 0 10px"> PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
</span><span class="cx" style="display: block; padding: 0 10px"> LOCAL_PHP_MEMCACHED: ${{ false }}
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- SLOW_TESTS: 'external-http,media,restapi'
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> jobs:
</span><span class="cx" style="display: block; padding: 0 10px"> # Runs the PHPUnit tests for WordPress.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,7 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> # - Checks out the WordPress Test reporter repository.
</span><span class="cx" style="display: block; padding: 0 10px"> # - Submit the test results to the WordPress.org host test results.
</span><span class="cx" style="display: block; padding: 0 10px"> test-php:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
</ins><span class="cx" style="display: block; padding: 0 10px"> runs-on: ${{ matrix.os }}
</span><span class="cx" style="display: block; padding: 0 10px"> permissions:
</span><span class="cx" style="display: block; padding: 0 10px"> contents: read
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -65,23 +64,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> strategy:
</span><span class="cx" style="display: block; padding: 0 10px"> fail-fast: false
</span><span class="cx" style="display: block; padding: 0 10px"> matrix:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
</ins><span class="cx" style="display: block; padding: 0 10px"> os: [ ubuntu-latest ]
</span><span class="cx" style="display: block; padding: 0 10px"> memcached: [ false ]
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- split_slow: [ false ]
</del><span class="cx" style="display: block; padding: 0 10px"> multisite: [ false, true ]
</span><span class="cx" style="display: block; padding: 0 10px"> include:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- # Additional "slow" jobs for PHP 5.6.
- - php: '5.6'
- os: ubuntu-latest
- memcached: false
- multisite: false
- split_slow: true
- - php: '5.6'
- os: ubuntu-latest
- memcached: false
- multisite: true
- split_slow: true
</del><span class="cx" style="display: block; padding: 0 10px"> # Include jobs for PHP 7.4 with memcached.
</span><span class="cx" style="display: block; padding: 0 10px"> - php: '7.4'
</span><span class="cx" style="display: block; padding: 0 10px"> os: ubuntu-latest
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,37 +161,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> - name: Install WordPress
</span><span class="cx" style="display: block; padding: 0 10px"> run: npm run env:install
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- - name: Run slow PHPUnit tests
- if: ${{ matrix.split_slow }}
- run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ${{ env.SLOW_TESTS }}
-
- - name: Run PHPUnit tests for single site excluding slow tests
- if: ${{ matrix.php < '7.0' && ! matrix.split_slow && ! matrix.multisite }}
- run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-required
-
- - name: Run PHPUnit tests for Multisite excluding slow tests
- if: ${{ matrix.php < '7.0' && ! matrix.split_slow && matrix.multisite }}
- run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --exclude-group ${{ env.SLOW_TESTS }},ajax,ms-files,ms-excluded,oembed-headers
-
</del><span class="cx" style="display: block; padding: 0 10px"> - name: Run PHPUnit tests
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if: ${{ matrix.php >= '7.0' }}
</del><span class="cx" style="display: block; padding: 0 10px"> run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> - name: Run AJAX tests
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if: ${{ ! matrix.split_slow }}
</del><span class="cx" style="display: block; padding: 0 10px"> run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> - name: Run ms-files tests as a multisite install
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if: ${{ matrix.multisite && ! matrix.split_slow }}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if: ${{ matrix.multisite }}
</ins><span class="cx" style="display: block; padding: 0 10px"> run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> - name: Run external HTTP tests
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if: ${{ ! matrix.multisite && ! matrix.split_slow }}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if: ${{ ! matrix.multisite }}
</ins><span class="cx" style="display: block; padding: 0 10px"> run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
</span><span class="cx" style="display: block; padding: 0 10px"> - name: Run (Xdebug) tests
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if: ${{ ! matrix.split_slow }}
</del><span class="cx" style="display: block; padding: 0 10px"> run: LOCAL_PHP_XDEBUG=true node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit -v --group xdebug --exclude-group __fakegroup__
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> - name: Ensure version-controlled files are not modified or deleted
</span></span></pre></div>
<a id="trunkcomposerjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/composer.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/composer.json 2023-07-05 16:19:39 UTC (rev 56140)
+++ trunk/composer.json 2023-07-05 17:39:55 UTC (rev 56141)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,7 +10,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "issues": "https://core.trac.wordpress.org/"
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "require": {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "php": ">=5.6"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "php": ">=7.0"
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "require-dev": {
</span><span class="cx" style="display: block; padding: 0 10px"> "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
</span></span></pre></div>
<a id="trunkphpcompatxmldist"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/phpcompat.xml.dist</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/phpcompat.xml.dist 2023-07-05 16:19:39 UTC (rev 56140)
+++ trunk/phpcompat.xml.dist 2023-07-05 17:39:55 UTC (rev 56141)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,8 +4,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <rule ref="PHPCompatibilityWP"/>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <!-- WordPress Core currently supports PHP 5.6+. -->
- <config name="testVersion" value="5.6-"/>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <!-- WordPress Core currently supports PHP 7.0+. -->
+ <config name="testVersion" value="7.0-"/>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- Only scan PHP files. -->
</span><span class="cx" style="display: block; padding: 0 10px"> <arg name="extensions" value="php"/>
</span></span></pre></div>
<a id="trunksrcreadmehtml"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/readme.html</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/readme.html 2023-07-05 16:19:39 UTC (rev 56140)
+++ trunk/src/readme.html 2023-07-05 17:39:55 UTC (rev 56141)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +51,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <h2>System Requirements</h2>
</span><span class="cx" style="display: block; padding: 0 10px"> <ul>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <li><a href="https://secure.php.net/">PHP</a> version <strong>5.6.20</strong> or greater.</li>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <li><a href="https://secure.php.net/">PHP</a> version <strong>7.0</strong> or greater.</li>
</ins><span class="cx" style="display: block; padding: 0 10px"> <li><a href="https://www.mysql.com/">MySQL</a> version <strong>5.0</strong> or greater.</li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludescompatphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/compat.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/compat.php 2023-07-05 16:19:39 UTC (rev 56140)
+++ trunk/src/wp-includes/compat.php 2023-07-05 17:39:55 UTC (rev 56141)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -333,10 +333,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> endif;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// random_int() was introduced in PHP 7.0.
-if ( ! function_exists( 'random_int' ) ) {
- require ABSPATH . WPINC . '/random_compat/random.php';
-}
</del><span class="cx" style="display: block; padding: 0 10px"> // sodium_crypto_box() was introduced in PHP 7.2.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! function_exists( 'sodium_crypto_box' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> require ABSPATH . WPINC . '/sodium_compat/autoload.php';
</span></span></pre></div>
<a id="trunksrcwpincludesversionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/version.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/version.php 2023-07-05 16:19:39 UTC (rev 56140)
+++ trunk/src/wp-includes/version.php 2023-07-05 17:39:55 UTC (rev 56141)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -37,7 +37,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global string $required_php_version
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$required_php_version = '5.6.20';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$required_php_version = '7.0.0';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Holds the required MySQL version.
</span></span></pre></div>
<a id="trunktestsphpunittestsadminwpMediaListTablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/wpMediaListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpMediaListTable.php 2023-07-05 16:19:39 UTC (rev 56140)
+++ trunk/tests/phpunit/tests/admin/wpMediaListTable.php 2023-07-05 17:39:55 UTC (rev 56141)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,7 +114,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * does not result in a PHP warning.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * The warning that we should not see:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * PHP 5.6 - 7.4: `Invalid argument supplied for foreach()`.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * PHP <= 7.4: `Invalid argument supplied for foreach()`.
</ins><span class="cx" style="display: block; padding: 0 10px"> * PHP 8.0 and higher: `Warning: foreach() argument must be of type array|object, bool given`.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Note: This does not test the actual functioning of the WP_Media_List_Table::prepare_items() method.
</span></span></pre></div>
<a id="trunktestsphpunittestsdatedateI18nphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/date/dateI18n.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/date/dateI18n.php 2023-07-05 16:19:39 UTC (rev 56140)
+++ trunk/tests/phpunit/tests/date/dateI18n.php 2023-07-05 17:39:55 UTC (rev 56141)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,10 +117,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> update_option( 'timezone_string', 'America/Buenos_Aires' ); // This timezone was deprecated pre-PHP 5.6.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $expected = '2022-08-01 00:00:00 -03 -03:00 America/Buenos_Aires';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( PHP_VERSION_ID < 70000 ) {
- // PHP 5.6.
- $expected = '2022-08-01 00:00:00 ART -03:00 America/Buenos_Aires';
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $expected, date_i18n( 'Y-m-d H:i:s T P e', strtotime( '2022-08-01 00:00:00' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionswpListUtilphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/functions/wpListUtil.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions/wpListUtil.php 2023-07-05 16:19:39 UTC (rev 56140)
+++ trunk/tests/phpunit/tests/functions/wpListUtil.php 2023-07-05 17:39:55 UTC (rev 56141)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,6 +210,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_wp_list_util_sort_int_arrays
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_wp_list_util_sort_arrays_of_arrays
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider data_wp_list_util_sort_object_arrays
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @dataProvider data_wp_list_util_sort_non_existent_orderby_fields
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers WP_List_Util::sort
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_list_sort
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1002,54 +1003,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Tests non-existent '$orderby' fields.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Data provider for test_wp_list_util_sort().
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * In PHP < 7.0.0, the sorting behavior is different, which Core does not
- * currently handle. Until this is fixed, or the minimum PHP version is
- * raised to PHP 7.0.0+, these tests will be skipped on PHP < 7.0.0.
- *
- * @ticket 55300
- *
- * @dataProvider data_wp_list_util_sort_php_7_or_greater
- *
- * @covers WP_List_Util::sort
- * @covers ::wp_list_sort
- *
- * @param array $expected The expected array.
- * @param array $target_array The array to create a list from.
- * @param array $orderby Optional. Either the field name to order by or an array
- * of multiple orderby fields as `$orderby => $order`.
- * Default empty array.
- * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if `$orderby`
- * is a string. Default 'ASC'.
- * @param bool $preserve_keys Optional. Whether to preserve keys. Default false.
- */
- public function test_wp_list_util_sort_php_7_or_greater( $expected, $target_array, $orderby = array(), $order = 'ASC', $preserve_keys = false ) {
- if ( version_compare( PHP_VERSION, '7.0.0', '<' ) ) {
- $this->markTestSkipped( 'This test can only run on PHP 7.0 or greater due to an unstable sort order.' );
- }
-
- $util = new WP_List_Util( $target_array );
- $actual = $util->sort( $orderby, $order, $preserve_keys );
-
- $this->assertEqualSetsWithIndex(
- $expected,
- $actual,
- 'The sorted value did not match the expected value.'
- );
- $this->assertEqualSetsWithIndex(
- $expected,
- $util->get_output(),
- '::get_output() did not return the expected value.'
- );
- }
-
- /**
- * Data provider for test_wp_list_util_sort_php_7_or_greater().
- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @return array[]
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function data_wp_list_util_sort_php_7_or_greater() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function data_wp_list_util_sort_non_existent_orderby_fields() {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'int[], int keys, $orderby a non-existent field, $order = ASC and $preserve_keys = false' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'expected' => array( 4, 2, 3, 1 ),
</span></span></pre>
</div>
</div>
</body>
</html>