Verified Commit 47614c47 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...

Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login link instead of user login form in BrowserTestBase tests

(cherry picked from commit 104f8285)
parent bff52f8e
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -28,6 +28,11 @@ class LocaleTranslatedSchemaDefinitionTest extends BrowserTestBase {
   */
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected bool $useOneTimeLoginLinks = FALSE;

  /**
   * {@inheritdoc}
   */
+5 −0
Original line number Diff line number Diff line
@@ -29,6 +29,11 @@ class LocaleTranslationUiTest extends BrowserTestBase {
   */
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected bool $useOneTimeLoginLinks = FALSE;

  /**
   * Enable interface translation to English.
   */
+7 −1
Original line number Diff line number Diff line
@@ -169,7 +169,13 @@ public function testPasswordRehashOnLogin(): void {
    $this->assertTrue($password_hasher->needsRehash($account->getPassword()));

    $account->passRaw = $password;
    $this->drupalLogin($account);
    $this->drupalGet('user/login');
    $edit = [
      'name' => $account->getAccountName(),
      'pass' => $account->passRaw,
    ];
    $this->submitForm($edit, 'Log in');

    // Load the stored user, which should have a different password hash now.
    $user_storage->resetCache([$account->id()]);
    $account = $user_storage->load($account->id());
+5 −0
Original line number Diff line number Diff line
@@ -27,6 +27,11 @@ class UserTokenReplaceTest extends BrowserTestBase {
   */
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected bool $useOneTimeLoginLinks = FALSE;

  /**
   * {@inheritdoc}
   */
+1 −1
Original line number Diff line number Diff line
@@ -521,7 +521,7 @@ function user_user_logout(AccountInterface $account) {
 *   they can change their password.
 */
function user_pass_reset_url($account, $options = []) {
  $timestamp = \Drupal::time()->getRequestTime();
  $timestamp = \Drupal::time()->getCurrentTime();
  $langcode = $options['langcode'] ?? $account->getPreferredLangcode();
  return Url::fromRoute('user.reset',
    [
Loading