Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ private function do_redirect_callable( $callback ) {
private function reset_profile_errors() {
$reflection = new ReflectionClass( Two_Factor_Core::class );
$prop = $reflection->getProperty( 'profile_errors' );
$prop->setAccessible( true );
if ( PHP_VERSION_ID < 80100 ) {
$prop->setAccessible( true );
}
$prop->setValue( null, array() );
}

Expand Down Expand Up @@ -2371,7 +2373,9 @@ public function test_collect_auth_cookie_tokens() {
// but capture the original value so it can be restored afterward.
$reflection = new ReflectionClass( Two_Factor_Core::class );
$prop = $reflection->getProperty( 'password_auth_tokens' );
$prop->setAccessible( true );
if ( PHP_VERSION_ID < 80100 ) {
$prop->setAccessible( true );
}
$original_tokens = $prop->getValue( null );

try {
Expand Down
4 changes: 3 additions & 1 deletion tests/providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,9 @@ public function test_sha512_authenticate() {
*/
private function call_pad_secret( $secret, $length ) {
$method = new ReflectionMethod( 'Two_Factor_Totp', 'pad_secret' );
$method->setAccessible( true );
if ( PHP_VERSION_ID < 80100 ) {
$method->setAccessible( true );
}
return $method->invoke( null, $secret, $length );
}

Expand Down
Loading