Commit 590e5d7f authored by Ide Braakman's avatar Ide Braakman
Browse files

Issue #3277104 by idebr: Fix test failures on 8.x-1.x branch

parent efab1153
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -19,6 +19,11 @@ class GuardedUsersTest extends BrowserTestBase {
    getMails as drupalGetMails;
  }

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * A guarded user.
   *
@@ -29,7 +34,7 @@ class GuardedUsersTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  public function setUp() {
  public function setUp(): void {
    parent::setUp();
    $settings['settings']['guardian_mail'] = (object) [
      'value' => 'bob@example.com',
@@ -53,10 +58,11 @@ class GuardedUsersTest extends BrowserTestBase {
    $this->drupalLogin($this->guardedUser);

    // Install the guardian module.
    $this->drupalGet('admin/modules');
    $edit_enable = [
      'modules[guardian][enable]' => TRUE,
    ];
    $this->drupalPostForm('admin/modules', $edit_enable, 'Install');
    $this->submitForm($edit_enable, 'Install');
    $this->rebuildContainer();
    $this->resetAll();

@@ -83,7 +89,8 @@ class GuardedUsersTest extends BrowserTestBase {
    $this->assertFalse($this->drupalUserIsLoggedIn($this->guardedUser));

    // Check a guarded user can log in using the password reset email.
    $this->drupalPostForm('user/password', ['name' => $this->guardedUser->getAccountName()], 'Submit');
    $this->drupalGet('user/password');
    $this->submitForm(['name' => $this->guardedUser->getAccountName()], 'Submit');
    $reset_url = $this->getResetUrl();
    $this->drupalGet($reset_url . '/login');
    $this->assertSession()->responseContains('You have just used your one-time login link. It is no longer necessary to use this link to log in. Please change your password.');