function UserPasswordResetTestCase::testUserPasswordReset

7.x user.test UserPasswordResetTestCase::testUserPasswordReset()

Tests password reset functionality.

File

drupal-7.x/modules/user/user.test, line 471
Tests for user.module.

Class

UserPasswordResetTestCase
Tests resetting a user password.

Code

function testUserPasswordReset() {
  // Create a user.
  $account = $this->drupalCreateUser();
  $this->drupalLogin($account);
  $this->drupalLogout();
  // Attempt to reset password.
  $edit = array('name' => $account->name);
  $this->drupalPost('user/password', $edit, t('E-mail new password'));
  // Confirm the password reset.
  $this->assertText(t('Further instructions have been sent to your e-mail address.'), 'Password reset instructions mailed message displayed.');
}