- Timestamp:
- 09/11/2025 02:45:56 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/error-protection/wpRecoveryModeCookieService.php
r51650 r60729 36 36 $service = new WP_Recovery_Mode_Cookie_Service(); 37 37 $reflection = new ReflectionMethod( $service, 'recovery_mode_hash' ); 38 $reflection->setAccessible( true ); 38 if ( PHP_VERSION_ID < 80100 ) { 39 $reflection->setAccessible( true ); 40 } 39 41 40 42 $to_sign = sprintf( 'recovery_mode|%s|%s', time() - WEEK_IN_SECONDS - 30, wp_generate_password( 20, false ) ); … … 55 57 $service = new WP_Recovery_Mode_Cookie_Service(); 56 58 $reflection = new ReflectionMethod( $service, 'generate_cookie' ); 57 $reflection->setAccessible( true ); 59 if ( PHP_VERSION_ID < 80100 ) { 60 $reflection->setAccessible( true ); 61 } 58 62 59 63 $cookie = $reflection->invoke( $service ); … … 73 77 $service = new WP_Recovery_Mode_Cookie_Service(); 74 78 $reflection = new ReflectionMethod( $service, 'recovery_mode_hash' ); 75 $reflection->setAccessible( true ); 79 if ( PHP_VERSION_ID < 80100 ) { 80 $reflection->setAccessible( true ); 81 } 76 82 77 83 $to_sign = sprintf( 'recovery_mode|%s|%s', 'month', wp_generate_password( 20, false ) ); … … 93 99 $service = new WP_Recovery_Mode_Cookie_Service(); 94 100 $reflection = new ReflectionMethod( $service, 'generate_cookie' ); 95 $reflection->setAccessible( true ); 101 if ( PHP_VERSION_ID < 80100 ) { 102 $reflection->setAccessible( true ); 103 } 96 104 97 105 $this->assertTrue( $service->validate_cookie( $reflection->invoke( $service ) ) );
Note: See TracChangeset
for help on using the changeset viewer.