From 6c78848612c52bd003239bf4418d6c8a22707227 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 1 Aug 2019 19:53:45 +0000 Subject: [PATCH] Users: Clean user cache in `check_password_reset_key()` tests. Props davidbaumwald, spacedmonkey. See #45845. git-svn-id: https://develop.svn.wordpress.org/trunk@45717 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/auth.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/phpunit/tests/auth.php b/tests/phpunit/tests/auth.php index e40e52fd10..177602404b 100644 --- a/tests/phpunit/tests/auth.php +++ b/tests/phpunit/tests/auth.php @@ -256,6 +256,7 @@ class Tests_Auth extends WP_UnitTestCase { 'ID' => $this->user->ID, ) ); + clean_user_cache( $this->user ); // A valid key should be accepted $check = check_password_reset_key( $key, $this->user->user_login ); @@ -293,6 +294,7 @@ class Tests_Auth extends WP_UnitTestCase { 'ID' => $this->user->ID, ) ); + clean_user_cache( $this->user ); // An expired but otherwise valid key should be rejected $check = check_password_reset_key( $key, $this->user->user_login ); @@ -330,6 +332,7 @@ class Tests_Auth extends WP_UnitTestCase { 'ID' => $this->user->ID, ) ); + clean_user_cache( $this->user ); // A legacy user_activation_key should not be accepted $check = check_password_reset_key( $key, $this->user->user_login ); @@ -359,6 +362,7 @@ class Tests_Auth extends WP_UnitTestCase { 'ID' => $this->user->ID, ) ); + clean_user_cache( $this->user ); // A plaintext user_activation_key should not allow an otherwise valid key to be accepted $check = check_password_reset_key( $key, $this->user->user_login );