Skip to content

Commit 3b6ad40

Browse files
authored
Merge pull request #455 from wp-cli/fix/php85-tests
2 parents 5f142ee + 0063361 commit 3b6ad40

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tests/IterableCodeExtractorTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ public function set_up() {
2222
self::$base = Utils\normalize_path( __DIR__ ) . '/data/';
2323

2424
$property = new \ReflectionProperty( TestIterableCodeExtractor::class, 'dir' );
25-
$property->setAccessible( true );
25+
if ( PHP_VERSION_ID < 80100 ) {
26+
$property->setAccessible( true );
27+
}
2628
$property->setValue( null, self::$base );
27-
$property->setAccessible( false );
29+
if ( PHP_VERSION_ID < 80100 ) {
30+
$property->setAccessible( false );
31+
}
2832
}
2933

3034
public function tear_down() {
@@ -211,7 +215,9 @@ public function test_can_include_file_in_symlinked_folder() {
211215
protected static function get_method_as_public( $class_name, $method_name ) {
212216
$class = new \ReflectionClass( $class_name );
213217
$method = $class->getMethod( $method_name );
214-
$method->setAccessible( true );
218+
if ( PHP_VERSION_ID < 80100 ) {
219+
$method->setAccessible( true );
220+
}
215221
return $method;
216222
}
217223

tests/MakeJsonMapTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public function set_up() {
2727
self::$obj = new MakeJsonCommand();
2828
$reflection = new \ReflectionClass( get_class( self::$obj ) );
2929
self::$build_map = $reflection->getMethod( 'build_map' );
30-
self::$build_map->setAccessible( true );
30+
if ( PHP_VERSION_ID < 80100 ) {
31+
self::$build_map->setAccessible( true );
32+
}
3133
}
3234

3335
public function test_no_map() {

0 commit comments

Comments
 (0)