1 user_password_reset.test UserPasswordResetTest::testUserResetPasswordTextboxFilled()

Prefill the text box on incorrect login via link to password reset page.

File

core/modules/user/tests/user_password_reset.test, line 137
Tests for resetting the password.

Class

UserPasswordResetTest

Code

function testUserResetPasswordTextboxFilled() {
  $this->backdropGet('user/login');
  $edit = array(
    'name' => $this->randomName(),
    'pass' => $this->randomName(),
  );
  $this->backdropPost('user', $edit, t('Log in'));
  $this->assertText(t('Sorry, unrecognized username.'));
  unset($edit['pass']);
  $this->backdropGet('user/password', array('query' => array('name' => $edit['name'])));
  $this->assertFieldByName('name', $edit['name'], 'User name pre-populated into name field.');
}