You are here

public function SessionLimitBaseTestCase::closeAllSessions in Session Limit 7.2

Same name and namespace in other branches
  1. 8 tests/session_limit.test \SessionLimitBaseTestCase::closeAllSessions()
  2. 6.2 tests/session_limit.test \SessionLimitBaseTestCase::closeAllSessions()
  3. 2.x tests/session_limit.test \SessionLimitBaseTestCase::closeAllSessions()

Close all stashed sessions and the current session.

4 calls to SessionLimitBaseTestCase::closeAllSessions()
SessionLimitLogoutTestCase::testSessionLogoutOnMax1 in tests/session_limit.test
Test user can only have 1 session, logout oldest.
SessionLimitLogoutTestCase::testSessionLogoutOnMax2 in tests/session_limit.test
Test user can only have 2 sessions, logout oldest.
SessionLimitPreventTestCase::testSessionPreventOnMax1 in tests/session_limit.test
Test user can only have 1 session, prevent new sessions.
SessionLimitPreventTestCase::testSessionPreventOnMax2 in tests/session_limit.test
Test user can only have 2 sessions, prevent new sessions.

File

tests/session_limit.test, line 247
Simpletest tests for session_limit.

Class

SessionLimitBaseTestCase
Base test for session limits.

Code

public function closeAllSessions() {
  foreach ($this->curlHandles as $cookie_file => $curl_handle) {
    if (isset($curl_handle)) {
      curl_close($curl_handle);
    }
  }

  // Make the server forget all sessions.
  db_truncate('sessions')
    ->execute();
  $this->curlHandles = array();
  $this->loggedInUsers = array();
  $this->loggedInUser = FALSE;
  $this->cookieFile = $this->public_files_directory . '/' . $this
    ->randomName() . '.jar';
  unset($this->curlHandle);
}