diff --git a/tests/IterableCodeExtractorTest.php b/tests/IterableCodeExtractorTest.php index 30e5e752..ae367eec 100644 --- a/tests/IterableCodeExtractorTest.php +++ b/tests/IterableCodeExtractorTest.php @@ -22,9 +22,13 @@ public function set_up() { self::$base = Utils\normalize_path( __DIR__ ) . '/data/'; $property = new \ReflectionProperty( TestIterableCodeExtractor::class, 'dir' ); - $property->setAccessible( true ); + if ( PHP_VERSION_ID < 80100 ) { + $property->setAccessible( true ); + } $property->setValue( null, self::$base ); - $property->setAccessible( false ); + if ( PHP_VERSION_ID < 80100 ) { + $property->setAccessible( false ); + } } public function tear_down() { @@ -211,7 +215,9 @@ public function test_can_include_file_in_symlinked_folder() { protected static function get_method_as_public( $class_name, $method_name ) { $class = new \ReflectionClass( $class_name ); $method = $class->getMethod( $method_name ); - $method->setAccessible( true ); + if ( PHP_VERSION_ID < 80100 ) { + $method->setAccessible( true ); + } return $method; } diff --git a/tests/MakeJsonMapTest.php b/tests/MakeJsonMapTest.php index 4cc7a38a..c24d3e50 100644 --- a/tests/MakeJsonMapTest.php +++ b/tests/MakeJsonMapTest.php @@ -27,7 +27,9 @@ public function set_up() { self::$obj = new MakeJsonCommand(); $reflection = new \ReflectionClass( get_class( self::$obj ) ); self::$build_map = $reflection->getMethod( 'build_map' ); - self::$build_map->setAccessible( true ); + if ( PHP_VERSION_ID < 80100 ) { + self::$build_map->setAccessible( true ); + } } public function test_no_map() {