Skip to content

Commit c8f9e24

Browse files
committed
Fix Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect
1 parent 8fa26b8 commit c8f9e24

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/phpunit/tests/abilities-api/wpRegisterAbility.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,9 @@ public function test_get_existing_ability() {
456456
// Reset the Registry, to ensure it's empty before the test.
457457
$registry_reflection = new ReflectionClass( WP_Abilities_Registry::class );
458458
$instance_prop = $registry_reflection->getProperty( 'instance' );
459-
$instance_prop->setAccessible( true );
459+
if ( PHP_VERSION_ID < 80100 ) {
460+
$instance_prop->setAccessible( true );
461+
}
460462
$instance_prop->setValue( null, null );
461463

462464
$result = wp_get_ability( $name );

0 commit comments

Comments
 (0)