<!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>[46214] trunk: Code Modernization: Remove all code using a `version_compare()` with a PHP version older than PHP 5.6.</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/46214">46214</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/46214","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-09-20 22:01:36 +0000 (Fri, 20 Sep 2019)</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'>Code Modernization: Remove all code using a `version_compare()` with a PHP version older than PHP 5.6.
Props jrf.
Fixes <a href="https://core.trac.wordpress.org/ticket/48074">#48074</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkphpunitxmldist">trunk/phpunit.xml.dist</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizemanagerphp">trunk/src/wp-includes/class-wp-customize-manager.php</a></li>
<li><a href="#trunksrcwpincludesclasswplocalephp">trunk/src/wp-includes/class-wp-locale.php</a></li>
<li><a href="#trunksrcwpincludesformattingphp">trunk/src/wp-includes/formatting.php</a></li>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
<li><a href="#trunktestsphpunitincludesutilsphp">trunk/tests/phpunit/includes/utils.php</a></li>
<li><a href="#trunktestsphpunitmultisitexml">trunk/tests/phpunit/multisite.xml</a></li>
<li><a href="#trunktestsphpunittestsadminwpPrivacyRequestsTablephp">trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php</a></li>
<li><a href="#trunktestsphpunittestscompatphp">trunk/tests/phpunit/tests/compat.php</a></li>
<li><a href="#trunktestsphpunittestscustomizenavmenusphp">trunk/tests/phpunit/tests/customize/nav-menus.php</a></li>
<li><a href="#trunktestsphpunittestsdbcharsetphp">trunk/tests/phpunit/tests/db/charset.php</a></li>
<li><a href="#trunktestsphpunittestsfunctionsphp">trunk/tests/phpunit/tests/functions.php</a></li>
<li><a href="#trunktestsphpunittestspostqueryphp">trunk/tests/phpunit/tests/post/query.php</a></li>
<li><a href="#trunktestsphpunittestsrestapirestrequestphp">trunk/tests/phpunit/tests/rest-api/rest-request.php</a></li>
<li><a href="#trunktestsphpunitteststhemecustomHeaderphp">trunk/tests/phpunit/tests/theme/customHeader.php</a></li>
<li><a href="#trunktestsphpunittestswidgetsmediawidgetphp">trunk/tests/phpunit/tests/widgets/media-widget.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkphpunitxmldist"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/phpunit.xml.dist</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/phpunit.xml.dist 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/phpunit.xml.dist 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8,16 +8,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- Default test suite to run all tests -->
</span><span class="cx" style="display: block; padding: 0 10px"> <testsuite name="default">
</span><span class="cx" style="display: block; padding: 0 10px"> <directory suffix=".php">tests/phpunit/tests</directory>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <file phpVersion="5.3.0">tests/phpunit/tests/actions/closures.php</file>
- <file phpVersion="5.3.0">tests/phpunit/tests/image/editor.php</file>
- <file phpVersion="5.3.0">tests/phpunit/tests/image/editorGd.php</file>
- <file phpVersion="5.3.0">tests/phpunit/tests/image/editorImagick.php</file>
- <file phpVersion="5.3.0">tests/phpunit/tests/oembed/headers.php</file>
- <exclude>tests/phpunit/tests/actions/closures.php</exclude>
- <exclude>tests/phpunit/tests/image/editor.php</exclude>
- <exclude>tests/phpunit/tests/image/editorGd.php</exclude>
- <exclude>tests/phpunit/tests/image/editorImagick.php</exclude>
- <exclude>tests/phpunit/tests/oembed/headers.php</exclude>
</del><span class="cx" style="display: block; padding: 0 10px"> <exclude>tests/phpunit/tests/rest-api/rest-autosaves-controller.php</exclude>
</span><span class="cx" style="display: block; padding: 0 10px"> </testsuite>
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- Sets the DOING_AUTOSAVE constant, so needs to be run last -->
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcustomizemanagerphp"></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/class-wp-customize-manager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-manager.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/src/wp-includes/class-wp-customize-manager.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1376,13 +1376,6 @@
</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">- // In PHP < 5.6 filesize() returns 0 for the temp files unless we clear the file status cache.
- // Technically, PHP < 5.6.0 || < 5.5.13 || < 5.4.29 but no need to be so targeted.
- // See https://bugs.php.net/bug.php?id=65701
- if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {
- clearstatcache();
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = media_handle_sideload( $file_array, 0, null, $attachment_post_data );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $attachment_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span></span></pre></div>
<a id="trunksrcwpincludesclasswplocalephp"></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/class-wp-locale.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-locale.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/src/wp-includes/class-wp-locale.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -199,13 +199,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: $thousands_sep argument for https://secure.php.net/number_format, default is ',' */
</span><span class="cx" style="display: block; padding: 0 10px"> $thousands_sep = __( 'number_format_thousands_sep' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) {
- // Replace space with a non-breaking space to avoid wrapping.
- $thousands_sep = str_replace( ' ', ' ', $thousands_sep );
- } else {
- // PHP < 5.4.0 does not support multiple bytes in thousands separator.
- $thousands_sep = str_replace( array( ' ', ' ' ), ' ', $thousands_sep );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Replace space with a non-breaking space to avoid wrapping.
+ $thousands_sep = str_replace( ' ', ' ', $thousands_sep );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->number_format['thousands_sep'] = ( 'number_format_thousands_sep' === $thousands_sep ) ? ',' : $thousands_sep;
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesformattingphp"></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/formatting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/formatting.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/src/wp-includes/formatting.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5572,15 +5572,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The encoded content.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_encode_emoji( $content ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $emoji = _wp_emoji_list( 'partials' );
- $compat = version_compare( phpversion(), '5.4', '<' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $emoji = _wp_emoji_list( 'partials' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $emoji as $emojum ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $compat ) {
- $emoji_char = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
- } else {
- $emoji_char = html_entity_decode( $emojum );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $emoji_char = html_entity_decode( $emojum );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false !== strpos( $content, $emoji_char ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $content = preg_replace( "/$emoji_char/", $emojum, $content );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5616,14 +5611,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Quickly narrow down the list of emoji that might be in the text and need replacing.
</span><span class="cx" style="display: block; padding: 0 10px"> $possible_emoji = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $compat = version_compare( phpversion(), '5.4', '<' );
</del><span class="cx" style="display: block; padding: 0 10px"> foreach ( $emoji as $emojum ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false !== strpos( $text, $emojum ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $compat ) {
- $possible_emoji[ $emojum ] = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
- } else {
- $possible_emoji[ $emojum ] = html_entity_decode( $emojum );
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $possible_emoji[ $emojum ] = html_entity_decode( $emojum );
</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">
</span></span></pre></div>
<a id="trunksrcwpincludesfunctionsphp"></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/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/src/wp-includes/functions.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -6004,12 +6004,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) {
</span><span class="cx" style="display: block; padding: 0 10px"> static $truncate_paths;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.2.5', '>=' ) ) {
- $trace = debug_backtrace( false );
- } else {
- $trace = debug_backtrace();
- }
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $trace = debug_backtrace( false );
</ins><span class="cx" style="display: block; padding: 0 10px"> $caller = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $check_class = ! is_null( $ignore_class );
</span><span class="cx" style="display: block; padding: 0 10px"> $skip_frames++; // skip this function
</span></span></pre></div>
<a id="trunktestsphpunitincludesutilsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/includes/utils.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/utils.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/includes/utils.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -465,12 +465,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function benchmark_pcre_backtracking( $pattern, $subject, $strategy ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $saved_config = ini_get( 'pcre.backtrack_limit' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Attempt to prevent PHP crashes. Adjust these lower when needed.
- if ( version_compare( phpversion(), '5.4.8', '>' ) ) {
- $limit = 1000000;
- } else {
- $limit = 20000; // 20,000 is a reasonable upper limit, but see also https://core.trac.wordpress.org/ticket/29557#comment:10
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Attempt to prevent PHP crashes. Adjust these lower when needed.
+ $limit = 1000000;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Start with small numbers, so if a crash is encountered at higher numbers we can still debug the problem.
</span><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 4; $i <= $limit; $i *= 2 ) {
</span></span></pre></div>
<a id="trunktestsphpunitmultisitexml"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/multisite.xml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/multisite.xml 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/multisite.xml 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,14 +12,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- Default test suite to run all tests -->
</span><span class="cx" style="display: block; padding: 0 10px"> <testsuite name="default">
</span><span class="cx" style="display: block; padding: 0 10px"> <directory suffix=".php">tests</directory>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <file phpVersion="5.3.0">tests/phpunit/tests/actions/closures.php</file>
- <file phpVersion="5.3.0">tests/phpunit/tests/image/editor.php</file>
- <file phpVersion="5.3.0">tests/phpunit/tests/image/editorGd.php</file>
- <file phpVersion="5.3.0">tests/phpunit/tests/image/editorImagick.php</file>
- <exclude>tests/phpunit/tests/actions/closures.php</exclude>
- <exclude>tests/phpunit/tests/image/editor.php</exclude>
- <exclude>tests/phpunit/tests/image/editorGd.php</exclude>
- <exclude>tests/phpunit/tests/image/editorImagick.php</exclude>
</del><span class="cx" style="display: block; padding: 0 10px"> <!-- Path relative to the checkout root, for PHPUnit 3.6.x -->
</span><span class="cx" style="display: block; padding: 0 10px"> <exclude>tests/phpunit/tests/rest-api/rest-autosaves-controller.php</exclude>
</span><span class="cx" style="display: block; padding: 0 10px"> <!-- Same path relative to the configuration file, for PHPUnit 4.0.0+ -->
</span></span></pre></div>
<a id="trunktestsphpunittestsadminwpPrivacyRequestsTablephp"></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/wpPrivacyRequestsTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,10 +24,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return PHPUnit_Framework_MockObject_MockObject|WP_Privacy_Requests_Table $instance Mocked class instance.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_mocked_class_instance() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
- $this->markTestSkipped( 'ReflectionMethod::setAccessible is only available in PHP 5.3+' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'plural' => 'privacy_requests',
</span><span class="cx" style="display: block; padding: 0 10px"> 'singular' => 'privacy_request',
</span></span></pre></div>
<a id="trunktestsphpunittestscompatphp"></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/compat.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/compat.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/tests/compat.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -249,11 +249,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->markTestSkipped( 'The intl extension is not loaded. ResourceBundle not tested for is_countable().' );
</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">- if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
- $this->markTestSkipped( 'ResourceBundle is only countable in PHP 5.4+' );
- return;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( is_countable( new ResourceBundle( 'en', null ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestscustomizenavmenusphp"></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/customize/nav-menus.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/customize/nav-menus.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/tests/customize/nav-menus.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1083,9 +1083,7 @@
</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"> // Add global namespace prefix to check #41488.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) {
- $original_args['fallback_cb'] = '\\' . $original_args['fallback_cb'];
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $original_args['fallback_cb'] = '\\' . $original_args['fallback_cb'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $menus->filter_wp_nav_menu_args( $original_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunittestsdbcharsetphp"></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/db/charset.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/db/charset.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/tests/db/charset.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -482,10 +482,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 21212
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_strip_invalid_text( $data, $expected, $message ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.3', '<' ) && stristr( php_uname( 's' ), 'win' ) ) {
- $this->markTestSkipped( 'This test fails in PHP 5.2 on Windows. See https://core.trac.wordpress.org/ticket/31262' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $charset = self::$_wpdb->charset;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $data[0]['connection_charset'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $new_charset = $data[0]['connection_charset'];
</span></span></pre></div>
<a id="trunktestsphpunittestsfunctionsphp"></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.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/functions.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/tests/functions.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -918,10 +918,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 28786
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_wp_json_encode_depth() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.5', '<' ) ) {
- $this->markTestSkipped( 'json_encode() supports the $depth parameter in PHP 5.5+' );
- };
-
</del><span class="cx" style="display: block; padding: 0 10px"> $data = array( array( array( 1, 2, 3 ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $json = wp_json_encode( $data, 0, 1 );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( $json );
</span></span></pre></div>
<a id="trunktestsphpunittestspostqueryphp"></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/post/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/post/query.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/tests/post/query.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -705,11 +705,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @dataProvider set_found_posts_provider
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_set_found_posts_not_posts_as_an_array( $posts, $expected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
- $this->markTestSkipped( 'ReflectionMethod::setAccessible is only available in PHP 5.3+' );
- return;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $q = new WP_Query(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_type' => 'wptests_pt',
</span></span></pre></div>
<a id="trunktestsphpunittestsrestapirestrequestphp"></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/rest-api/rest-request.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/rest-api/rest-request.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/tests/rest-api/rest-request.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -491,10 +491,6 @@
</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"> public function test_has_valid_params_json_error() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
- return $this->markTestSkipped( 'JSON validation is only available for PHP 5.3+' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_header( 'Content-Type', 'application/json' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_body( '{"invalid": JSON}' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -507,10 +503,6 @@
</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"> public function test_has_valid_params_empty_json_no_error() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
- return $this->markTestSkipped( 'JSON validation is only available for PHP 5.3+' );
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_header( 'Content-Type', 'application/json' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->request->set_body( '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunitteststhemecustomHeaderphp"></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/theme/customHeader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/theme/customHeader.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/tests/theme/customHeader.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -126,10 +126,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( has_custom_header() );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertEmpty( $html );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // ReflectionMethod::setAccessible is only available in PHP 5.3+
- if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
- return;
- }
</del><span class="cx" style="display: block; padding: 0 10px"> // The container should always be returned in the Customizer preview.
</span><span class="cx" style="display: block; padding: 0 10px"> $this->_set_customize_previewing( true );
</span><span class="cx" style="display: block; padding: 0 10px"> $html = get_custom_header_markup();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,11 +222,6 @@
</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"> function test_header_script_is_enqueued_by_the_custom_header_markup_without_video_when_previewing_in_customizer() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
- $this->markTestSkipped( 'ReflectionMethod::setAccessible is only available in PHP 5.3+' );
- return;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $this->_add_theme_support(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'video' => true,
</span></span></pre></div>
<a id="trunktestsphpunittestswidgetsmediawidgetphp"></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/widgets/media-widget.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/widgets/media-widget.php 2019-09-20 21:58:42 UTC (rev 46213)
+++ trunk/tests/phpunit/tests/widgets/media-widget.php 2019-09-20 22:01:36 UTC (rev 46214)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -479,11 +479,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers WP_Widget_Media::has_content()
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function test_has_content() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {
- $this->markTestSkipped( 'ReflectionMethod::setAccessible is only available for PHP 5.3+' );
- return;
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> $attachment_id = self::factory()->attachment->create_object(
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'file' => DIR_TESTDATA . '/images/canola.jpg',
</span></span></pre>
</div>
</div>
</body>
</html>