From a85803a7ba1cd643fdc5a617f750831e24f5bf05 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Mon, 9 Nov 2020 19:40:41 +0000 Subject: [PATCH] Build/Test Tools: Remove PHP >= 5.3 check. WordPress no longer supports PHP < 5.6.20. This check is no longer necessary. Fixes #51737. git-svn-id: https://develop.svn.wordpress.org/trunk@49551 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/functions.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index 674c05adfe..4f6a411694 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -276,15 +276,10 @@ class Tests_Functions extends WP_UnitTestCase { $serialized = maybe_serialize( $value ); if ( get_class( $value ) === 'Requests_Utility_FilteredIterator' ) { $new_value = unserialize( $serialized ); - if ( version_compare( PHP_VERSION, '5.3', '>=' ) ) { - $property = ( new ReflectionClass( 'Requests_Utility_FilteredIterator' ) )->getProperty( 'callback' ); - $property->setAccessible( true ); - $callback_value = $property->getValue( $new_value ); - $this->assertSame( null, $callback_value ); - } else { - $current_item = @$new_value->current(); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged - $this->assertSame( null, $current_item ); - } + $property = ( new ReflectionClass( 'Requests_Utility_FilteredIterator' ) )->getProperty( 'callback' ); + $property->setAccessible( true ); + $callback_value = $property->getValue( $new_value ); + $this->assertSame( null, $callback_value ); } else { $this->assertEquals( $value->count(), unserialize( $serialized )->count() ); }