You are here

public function RedirectTest::testNoRedirectAfterLogin in Login Destination 8.2

Same name and namespace in other branches
  1. 8 tests/src/Functional/RedirectTest.php \Drupal\Tests\login_destination\Functional\RedirectTest::testNoRedirectAfterLogin()

Tests no redirect after logging in without compatible destination rule.

When there are login destination rules, but none of them has a trigger on login configured, no redirect caused by a login destination rule should happen on login.

File

tests/src/Functional/RedirectTest.php, line 134

Class

RedirectTest
Tests redirects.

Namespace

Drupal\Tests\login_destination\Functional

Code

public function testNoRedirectAfterLogin() {
  $this
    ->createLoginDestinationToNode1([
    LoginDestination::TRIGGER_REGISTRATION,
    LoginDestination::TRIGGER_ONE_TIME_LOGIN,
    LoginDestination::TRIGGER_LOGOUT,
  ]);
  $this
    ->drupalLogin($this->account);

  // Ensure that no login destination redirect happened.
  $this
    ->assertSession()
    ->addressEquals('/user/2');
}