Loading tests/src/Functional/GuardedUsersTest.php +10 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,11 @@ class GuardedUsersTest extends BrowserTestBase { getMails as drupalGetMails; } /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * A guarded user. * Loading @@ -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', Loading @@ -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(); Loading @@ -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.'); Loading Loading
tests/src/Functional/GuardedUsersTest.php +10 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,11 @@ class GuardedUsersTest extends BrowserTestBase { getMails as drupalGetMails; } /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * A guarded user. * Loading @@ -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', Loading @@ -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(); Loading @@ -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.'); Loading