From 34931cf8c31a911d476c4b23286be7e8b3112b50 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 10 May 2018 20:15:18 +0000 Subject: [PATCH] General: Skip `test_is_countable_ResourceBundle()` on PHP 5.3 and below. `ResourceBundle` is only countable in PHP 5.4+, which can be considered an acceptable edge case for WordPress core purposes. Props jrf, ayeshrajans. Fixes #43583. git-svn-id: https://develop.svn.wordpress.org/trunk@43226 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/compat.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/tests/compat.php b/tests/phpunit/tests/compat.php index d6f348c195..a1ceab6dbc 100644 --- a/tests/phpunit/tests/compat.php +++ b/tests/phpunit/tests/compat.php @@ -246,6 +246,11 @@ EOT; $this->markTestSkipped( 'The intl extension is not loaded. ResourceBundle not tested for is_countable().' ); } + if ( version_compare( PHP_VERSION, '5.4', '<' ) ) { + $this->markTestSkipped( 'ResourceBundle is only countable in PHP 5.4+' ); + return; + } + $this->assertTrue( is_countable( new ResourceBundle( 'en', null ) ) ); }