diff --git a/core/modules/user/src/Form/UserPasswordResetForm.php b/core/modules/user/src/Form/UserPasswordResetForm.php index b2e5721..facd08d 100644 --- a/core/modules/user/src/Form/UserPasswordResetForm.php +++ b/core/modules/user/src/Form/UserPasswordResetForm.php @@ -72,12 +72,12 @@ public function getFormID() { public function buildForm(array $form, FormStateInterface $form_state, AccountInterface $user = NULL, $expiration_date = NULL, $timestamp = NULL, $hash = NULL) { if ($expiration_date) { $form['message'] = array('#markup' => $this->t('
This is a one-time login for %user_name and will expire on %expiration_date.
Click on this button to log in to the site and change your password.
', array('%user_name' => $user->getUsername(), '%expiration_date' => $expiration_date))); - $form['#title'] = t('Reset Password'); + $form['#title'] = $this->t('Reset Password'); } else { // No expiration for first time login. $form['message'] = array('#markup' => $this->t('This is a one-time login for %user_name.
Click on this button to log in to the site and change your password.
', array('%user_name' => $user->getUsername()))); - $form['#title'] = t('Set Password'); + $form['#title'] = $this->t('Set Password'); } $form['user'] = array( diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php index 3d89581..8d3c2d8 100644 --- a/core/modules/user/src/Tests/UserPasswordResetTest.php +++ b/core/modules/user/src/Tests/UserPasswordResetTest.php @@ -95,6 +95,7 @@ function testUserPasswordReset() { // Check the one-time login page. $this->assertText($this->account->getUsername(), 'One-time login page contains the correct username.'); $this->assertText(t('This login can be used only once.'), 'Found warning about one-time login.'); + $this->assertTitle(t('Reset Password | Drupal'), 'Page title is "Reset Password".'); // Check successful login. $this->drupalPostForm(NULL, NULL, t('Log in'));