You are here

public function ModerationDashboardRedirectTest::testRedirect in Moderation Dashboard 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/ModerationDashboardRedirectTest.php \Drupal\Tests\moderation_dashboard\Functional\ModerationDashboardRedirectTest::testRedirect()

Tests if login is redirected when the user didn't request another page.

File

tests/src/Functional/ModerationDashboardRedirectTest.php, line 28

Class

ModerationDashboardRedirectTest
Tests redirection to dashboard on login.

Namespace

Drupal\Tests\moderation_dashboard\Functional

Code

public function testRedirect() {
  $this
    ->drupalGet('user/login');
  $this
    ->submitForm([
    'name' => $this->user
      ->getDisplayName(),
    'pass' => $this->user->passRaw,
  ], t('Log in'));
  $this
    ->assertSession()
    ->addressEquals("user/{$this->user->id()}/moderation/dashboard");
}