function UserPasswordResetTestCase::testResetInvalidation
Make sure that password reset URLs are invalidated when the user's email address changes.
File
-
modules/
user/ user.test, line 882
Class
- UserPasswordResetTestCase
- Tests resetting a user password.
Code
function testResetInvalidation() {
$account = $this->drupalCreateUser();
$original_reset_url = user_pass_reset_url($account);
user_save($account, array(
'mail' => '1' . $account->mail,
));
$this->drupalGet($original_reset_url);
$this->assertText('You have tried to use a one-time login link that has either been used or is no longer valid. Please request a new one using the form below.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.