You are here

public function RedirectOnLoginTest::testEnabled in Moderation Dashboard 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/RedirectOnLoginTest.php \Drupal\Tests\moderation_dashboard\Functional\RedirectOnLoginTest::testEnabled()

Tests enabled redirect on login.

Throws

\Behat\Mink\Exception\ExpectationException

File

tests/src/Functional/RedirectOnLoginTest.php, line 17

Class

RedirectOnLoginTest
Tests redirect on login configuration.

Namespace

Drupal\Tests\moderation_dashboard\Functional

Code

public function testEnabled() {

  // Redirect is enabled by default.
  $this
    ->assertSame(TRUE, $this
    ->config('moderation_dashboard.settings')
    ->get('redirect_on_login'));

  // User is redirected.
  $this
    ->drupalLogin($this->user);
  $this
    ->assertSession()
    ->addressEquals("user/{$this->user->id()}/moderation-dashboard");
}