You are here

public function RedirectOnLoginTest::testDisabled 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::testDisabled()

Tests disabled redirect on login.

Throws

\Behat\Mink\Exception\ExpectationException

File

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

Class

RedirectOnLoginTest
Tests redirect on login configuration.

Namespace

Drupal\Tests\moderation_dashboard\Functional

Code

public function testDisabled() {

  // Set redirect to disabled.
  $this
    ->config('moderation_dashboard.settings')
    ->set('redirect_on_login', FALSE)
    ->save();

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