Changeset 46214
- Timestamp:
- 09/20/2019 10:01:36 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpunit.xml.dist
r45607 r46214 9 9 <testsuite name="default"> 10 10 <directory suffix=".php">tests/phpunit/tests</directory> 11 <file phpVersion="5.3.0">tests/phpunit/tests/actions/closures.php</file>12 <file phpVersion="5.3.0">tests/phpunit/tests/image/editor.php</file>13 <file phpVersion="5.3.0">tests/phpunit/tests/image/editorGd.php</file>14 <file phpVersion="5.3.0">tests/phpunit/tests/image/editorImagick.php</file>15 <file phpVersion="5.3.0">tests/phpunit/tests/oembed/headers.php</file>16 <exclude>tests/phpunit/tests/actions/closures.php</exclude>17 <exclude>tests/phpunit/tests/image/editor.php</exclude>18 <exclude>tests/phpunit/tests/image/editorGd.php</exclude>19 <exclude>tests/phpunit/tests/image/editorImagick.php</exclude>20 <exclude>tests/phpunit/tests/oembed/headers.php</exclude>21 11 <exclude>tests/phpunit/tests/rest-api/rest-autosaves-controller.php</exclude> 22 12 </testsuite> -
trunk/src/wp-includes/class-wp-customize-manager.php
r46206 r46214 1376 1376 ) 1377 1377 ); 1378 1379 // In PHP < 5.6 filesize() returns 0 for the temp files unless we clear the file status cache.1380 // Technically, PHP < 5.6.0 || < 5.5.13 || < 5.4.29 but no need to be so targeted.1381 // See https://bugs.php.net/bug.php?id=657011382 if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {1383 clearstatcache();1384 }1385 1378 1386 1379 $attachment_id = media_handle_sideload( $file_array, 0, null, $attachment_post_data ); -
trunk/src/wp-includes/class-wp-locale.php
r45932 r46214 200 200 $thousands_sep = __( 'number_format_thousands_sep' ); 201 201 202 if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) { 203 // Replace space with a non-breaking space to avoid wrapping. 204 $thousands_sep = str_replace( ' ', ' ', $thousands_sep ); 205 } else { 206 // PHP < 5.4.0 does not support multiple bytes in thousands separator. 207 $thousands_sep = str_replace( array( ' ', ' ' ), ' ', $thousands_sep ); 208 } 202 // Replace space with a non-breaking space to avoid wrapping. 203 $thousands_sep = str_replace( ' ', ' ', $thousands_sep ); 209 204 210 205 $this->number_format['thousands_sep'] = ( 'number_format_thousands_sep' === $thousands_sep ) ? ',' : $thousands_sep; -
trunk/src/wp-includes/formatting.php
r46164 r46214 5573 5573 */ 5574 5574 function wp_encode_emoji( $content ) { 5575 $emoji = _wp_emoji_list( 'partials' ); 5576 $compat = version_compare( phpversion(), '5.4', '<' ); 5575 $emoji = _wp_emoji_list( 'partials' ); 5577 5576 5578 5577 foreach ( $emoji as $emojum ) { 5579 if ( $compat ) { 5580 $emoji_char = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' ); 5581 } else { 5582 $emoji_char = html_entity_decode( $emojum ); 5583 } 5578 $emoji_char = html_entity_decode( $emojum ); 5584 5579 if ( false !== strpos( $content, $emoji_char ) ) { 5585 5580 $content = preg_replace( "/$emoji_char/", $emojum, $content ); … … 5617 5612 // Quickly narrow down the list of emoji that might be in the text and need replacing. 5618 5613 $possible_emoji = array(); 5619 $compat = version_compare( phpversion(), '5.4', '<' );5620 5614 foreach ( $emoji as $emojum ) { 5621 5615 if ( false !== strpos( $text, $emojum ) ) { 5622 if ( $compat ) { 5623 $possible_emoji[ $emojum ] = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' ); 5624 } else { 5625 $possible_emoji[ $emojum ] = html_entity_decode( $emojum ); 5626 } 5616 $possible_emoji[ $emojum ] = html_entity_decode( $emojum ); 5627 5617 } 5628 5618 } -
trunk/src/wp-includes/functions.php
r46206 r46214 6005 6005 static $truncate_paths; 6006 6006 6007 if ( version_compare( PHP_VERSION, '5.2.5', '>=' ) ) { 6008 $trace = debug_backtrace( false ); 6009 } else { 6010 $trace = debug_backtrace(); 6011 } 6012 6007 $trace = debug_backtrace( false ); 6013 6008 $caller = array(); 6014 6009 $check_class = ! is_null( $ignore_class ); -
trunk/tests/phpunit/includes/utils.php
r46127 r46214 466 466 $saved_config = ini_get( 'pcre.backtrack_limit' ); 467 467 468 // Attempt to prevent PHP crashes. Adjust these lower when needed. 469 if ( version_compare( phpversion(), '5.4.8', '>' ) ) { 470 $limit = 1000000; 471 } else { 472 $limit = 20000; // 20,000 is a reasonable upper limit, but see also https://core.trac.wordpress.org/ticket/29557#comment:10 473 } 468 // Attempt to prevent PHP crashes. Adjust these lower when needed. 469 $limit = 1000000; 474 470 475 471 // Start with small numbers, so if a crash is encountered at higher numbers we can still debug the problem. -
trunk/tests/phpunit/multisite.xml
r44790 r46214 13 13 <testsuite name="default"> 14 14 <directory suffix=".php">tests</directory> 15 <file phpVersion="5.3.0">tests/phpunit/tests/actions/closures.php</file>16 <file phpVersion="5.3.0">tests/phpunit/tests/image/editor.php</file>17 <file phpVersion="5.3.0">tests/phpunit/tests/image/editorGd.php</file>18 <file phpVersion="5.3.0">tests/phpunit/tests/image/editorImagick.php</file>19 <exclude>tests/phpunit/tests/actions/closures.php</exclude>20 <exclude>tests/phpunit/tests/image/editor.php</exclude>21 <exclude>tests/phpunit/tests/image/editorGd.php</exclude>22 <exclude>tests/phpunit/tests/image/editorImagick.php</exclude>23 15 <!-- Path relative to the checkout root, for PHPUnit 3.6.x --> 24 16 <exclude>tests/phpunit/tests/rest-api/rest-autosaves-controller.php</exclude> -
trunk/tests/phpunit/tests/admin/wpPrivacyRequestsTable.php
r44628 r46214 25 25 */ 26 26 public function get_mocked_class_instance() { 27 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {28 $this->markTestSkipped( 'ReflectionMethod::setAccessible is only available in PHP 5.3+' );29 }30 31 27 $args = array( 32 28 'plural' => 'privacy_requests', -
trunk/tests/phpunit/tests/compat.php
r46205 r46214 250 250 } 251 251 252 if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {253 $this->markTestSkipped( 'ResourceBundle is only countable in PHP 5.4+' );254 return;255 }256 257 252 $this->assertTrue( is_countable( new ResourceBundle( 'en', null ) ) ); 258 253 } -
trunk/tests/phpunit/tests/customize/nav-menus.php
r43571 r46214 1084 1084 1085 1085 // Add global namespace prefix to check #41488. 1086 if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) { 1087 $original_args['fallback_cb'] = '\\' . $original_args['fallback_cb']; 1088 } 1086 $original_args['fallback_cb'] = '\\' . $original_args['fallback_cb']; 1089 1087 1090 1088 $args = $menus->filter_wp_nav_menu_args( $original_args ); -
trunk/tests/phpunit/tests/db/charset.php
r45607 r46214 483 483 */ 484 484 function test_strip_invalid_text( $data, $expected, $message ) { 485 if ( version_compare( PHP_VERSION, '5.3', '<' ) && stristr( php_uname( 's' ), 'win' ) ) {486 $this->markTestSkipped( 'This test fails in PHP 5.2 on Windows. See https://core.trac.wordpress.org/ticket/31262' );487 }488 489 485 $charset = self::$_wpdb->charset; 490 486 if ( isset( $data[0]['connection_charset'] ) ) { -
trunk/tests/phpunit/tests/functions.php
r45755 r46214 919 919 */ 920 920 function test_wp_json_encode_depth() { 921 if ( version_compare( PHP_VERSION, '5.5', '<' ) ) {922 $this->markTestSkipped( 'json_encode() supports the $depth parameter in PHP 5.5+' );923 };924 925 921 $data = array( array( array( 1, 2, 3 ) ) ); 926 922 $json = wp_json_encode( $data, 0, 1 ); -
trunk/tests/phpunit/tests/post/query.php
r44701 r46214 706 706 */ 707 707 public function test_set_found_posts_not_posts_as_an_array( $posts, $expected ) { 708 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {709 $this->markTestSkipped( 'ReflectionMethod::setAccessible is only available in PHP 5.3+' );710 return;711 }712 713 708 $q = new WP_Query( 714 709 array( -
trunk/tests/phpunit/tests/rest-api/rest-request.php
r45607 r46214 492 492 493 493 public function test_has_valid_params_json_error() { 494 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {495 return $this->markTestSkipped( 'JSON validation is only available for PHP 5.3+' );496 }497 498 494 $this->request->set_header( 'Content-Type', 'application/json' ); 499 495 $this->request->set_body( '{"invalid": JSON}' ); … … 508 504 509 505 public function test_has_valid_params_empty_json_no_error() { 510 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {511 return $this->markTestSkipped( 'JSON validation is only available for PHP 5.3+' );512 }513 514 506 $this->request->set_header( 'Content-Type', 'application/json' ); 515 507 $this->request->set_body( '' ); -
trunk/tests/phpunit/tests/theme/customHeader.php
r43571 r46214 127 127 $this->assertEmpty( $html ); 128 128 129 // ReflectionMethod::setAccessible is only available in PHP 5.3+130 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {131 return;132 }133 129 // The container should always be returned in the Customizer preview. 134 130 $this->_set_customize_previewing( true ); … … 227 223 228 224 function test_header_script_is_enqueued_by_the_custom_header_markup_without_video_when_previewing_in_customizer() { 229 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {230 $this->markTestSkipped( 'ReflectionMethod::setAccessible is only available in PHP 5.3+' );231 return;232 }233 234 225 $this->_add_theme_support( 235 226 array( -
trunk/tests/phpunit/tests/widgets/media-widget.php
r45103 r46214 480 480 */ 481 481 function test_has_content() { 482 if ( version_compare( PHP_VERSION, '5.3', '<' ) ) {483 $this->markTestSkipped( 'ReflectionMethod::setAccessible is only available for PHP 5.3+' );484 return;485 }486 487 482 $attachment_id = self::factory()->attachment->create_object( 488 483 array(
Note: See TracChangeset
for help on using the changeset viewer.