You are here

protected function SimpleLdapSSOTestCase::deleteSessions in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 simple_ldap_sso/simple_ldap_sso.test \SimpleLdapSSOTestCase::deleteSessions()

Delete a session from the database.

This effectively logs out the user without deleting any cookies.

Parameters

int $uid: The user id to delete.

2 calls to SimpleLdapSSOTestCase::deleteSessions()
SimpleLdapSSOTestCase::prepareSSO in simple_ldap_sso/simple_ldap_sso.test
Mimick an SSO login.
SimpleLdapSSOTestCase::testSimpleLdapSSO in simple_ldap_sso/simple_ldap_sso.test
Test Simple LDAP SSO.

File

simple_ldap_sso/simple_ldap_sso.test, line 196
Simple LDAP SSO module tests.

Class

SimpleLdapSSOTestCase
@file Simple LDAP SSO module tests.

Code

protected function deleteSessions($uid) {

  // Delete the session from the session table, and then see if it gets
  // created again after accessing a page, to test SSO.
  $num_deleted = db_delete('sessions')
    ->condition('uid', $uid)
    ->execute();
  $sessions = $this
    ->getSessions($uid);
  $this
    ->assertFalse($sessions, t('The sessions were deleted from the database.'));
}