You are here

protected function SimpleLdapSSOTestCase::prepareSSO in Simple LDAP 7.2

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

Mimick an SSO login.

Logs in a user so that an SSO cookie is set, then deletes the session from the session table, essentially mimicking SSO.

Parameters

array $account: Optional, the account to pass to drupalLogin().

Return value

array The session data from the SSO cookie.

1 call to SimpleLdapSSOTestCase::prepareSSO()
SimpleLdapSSOTestCase::testSimpleLdapSSO in simple_ldap_sso/simple_ldap_sso.test
Test Simple LDAP SSO.

File

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

Class

SimpleLdapSSOTestCase
@file Simple LDAP SSO module tests.

Code

protected function prepareSSO(array $account = NULL) {
  if (!isset($account)) {
    $account = $this->testUser;
  }
  $this
    ->drupalLogin($account);
  $data = $this
    ->getSSOCookieData();
  $this
    ->deleteSessions($data['uid']);
  return $data;
}