Users: Use wp_update_user() in get_password_reset_key().

Props jayswadas, spacedmonkey, donmhico, SergeyBiryukov.
Fixes #45746.

git-svn-id: https://develop.svn.wordpress.org/trunk@45714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2019-08-01 17:24:20 +00:00
parent 65254fdc3e
commit f912470ac3
2 changed files with 35 additions and 10 deletions
+14
View File
@@ -226,6 +226,20 @@ class Tests_Auth extends WP_UnitTestCase {
$this->assertInstanceOf( 'WP_Error', $user );
}
/**
* @ticket 45746
*/
function test_user_activation_key_is_saved() {
$user = get_userdata( $this->user->ID );
$key = get_password_reset_key( $user );
// A correctly saved key should be accepted
$check = check_password_reset_key( $key, $this->user->user_login );
$this->assertNotWPError( $check );
$this->assertInstanceOf( 'WP_User', $check );
$this->assertSame( $this->user->ID, $check->ID );
}
/**
* @ticket 32429
*/