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
This commit is contained in:
Sergey Biryukov 2019-08-01 19:53:45 +00:00
parent eedb1193fc
commit 6c78848612

View File

@ -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 );