public function RedirectTest::testNoRedirectAfterUpdatingAccountWithoutLoginLink in Login Destination 8.2
Same name and namespace in other branches
- 8 tests/src/Functional/RedirectTest.php \Drupal\Tests\login_destination\Functional\RedirectTest::testNoRedirectAfterUpdatingAccountWithoutLoginLink()
Tests no redirect when updating account and not using one-time login link.
File
- tests/
src/ Functional/ RedirectTest.php, line 310
Class
- RedirectTest
- Tests redirects.
Namespace
Drupal\Tests\login_destination\FunctionalCode
public function testNoRedirectAfterUpdatingAccountWithoutLoginLink() {
// Create a login destination rule that triggers upon one-time login links.
$this
->createLoginDestinationToNode1([
LoginDestination::TRIGGER_ONE_TIME_LOGIN,
]);
// Login normally.
$this
->drupalLogin($this->account);
// Set password on account edit page.
$password = user_password();
$edit = [
'current_pass' => $this->account->passRaw,
'pass[pass1]' => $password,
'pass[pass2]' => $password,
];
$this
->drupalPostForm('user/2/edit', $edit, 'Save');
$this
->assertSession()
->pageTextContains('The changes have been saved.');
// Assert that the user is still on their account edit page.
$this
->assertSession()
->addressEquals('/user/2/edit');
}