You are here

public function RedirectTest::testRedirectAfterLogin 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::testRedirectAfterLogin()

Tests redirecting after login.

File

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

Class

RedirectTest
Tests redirects.

Namespace

Drupal\Tests\login_destination\Functional

Code

public function testRedirectAfterLogin() {
  $this
    ->createLoginDestinationToNode1([
    LoginDestination::TRIGGER_LOGIN,
  ]);
  $this
    ->drupalLogin($this->account);

  // Ensure that the redirect happened.
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->addressEquals('/node/1');
}