Skip to content

Commit 761f391

Browse files
committed
Privacy: Wrap Reflection*::setAccessible() call in conditional check.
These methods are no-ops since PHP 8.1 and deprecated since PHP 8.5. Reference: [https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible PHP RFC: Deprecations for PHP 8.5: Deprecate `Reflection*::setAccessible()`]. See #63956, #44267. git-svn-id: https://develop.svn.wordpress.org/trunk@60903 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 3cba156 commit 761f391

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/phpunit/tests/admin/wpPrivacyRequestsTable.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ public function test_get_timestamp_as_date() {
222222

223223
$reflection = new ReflectionClass( $table );
224224
$method = $reflection->getMethod( 'get_timestamp_as_date' );
225-
$method->setAccessible( true );
225+
if ( PHP_VERSION_ID < 80100 ) {
226+
$method->setAccessible( true );
227+
}
226228

227229
$date_format = __( 'Y/m/d' );
228230
$time_format = __( 'g:i a' );

0 commit comments

Comments
 (0)