You are here

public function SessionLimitLogoutTestCase::testSessionLogoutOnMax2 in Session Limit 2.x

Same name in this branch
  1. 2.x tests/session_limit.test \SessionLimitLogoutTestCase::testSessionLogoutOnMax2()
  2. 2.x tests/SessionLimitLogoutTestCase.php \Drupal\session_limit\SessionLimitLogoutTestCase::testSessionLogoutOnMax2()
Same name and namespace in other branches
  1. 8 tests/SessionLimitLogoutTestCase.php \Drupal\session_limit\SessionLimitLogoutTestCase::testSessionLogoutOnMax2()

Test user can only have 2 sessions, logout oldest.

File

tests/SessionLimitLogoutTestCase.php, line 42

Class

SessionLimitLogoutTestCase
Session limit functions when expected behaviour is to logout oldest session.

Namespace

Drupal\session_limit

Code

public function testSessionLogoutOnMax2() {

  // Set the default session limit.
  \Drupal::configFactory()
    ->getEditable('session_limit.settings')
    ->set('session_limit_max', 2)
    ->save();
  $this
    ->assertSessionLogout(2);
  $this
    ->closeAllSessions();
}