You are here

function CasTestHelper::setCasUser in CAS 7

Same name and namespace in other branches
  1. 6.3 cas.test \CasTestHelper::setCasUser()

Set the CAS username and attributes for the next CAS login request.

Parameters

$account: A user object with a valid CAS username field, or the CAS username as a string.

$attributes: Additional attributes for the CAS user.

Return value

The CAS username.

7 calls to CasTestHelper::setCasUser()
CasGatewayTestCase::testCasGatewayLoggedIn in ./cas.test
Test the CAS Gateway functionality of the user is logged in.
CasLoginBlockTestCase::testCasLoginBlock in ./cas.test
Tests the visibility and functionality of the CAS login block.
CasLoginRedirectionTestCase::testExistingUserLoginRedirection in ./cas.test
Verify login redirection for an existing user.
CasRequiredLoginTestCase::testCasExclude in ./cas.test
Test redirection prevented by cas_exclude.
CasRequiredLoginTestCase::testCasPages in ./cas.test
Test redirection forced by cas_access and cas_pages variables.

... See full list

File

./cas.test, line 162
Tests for cas.module.

Class

CasTestHelper
@file Tests for cas.module.

Code

function setCasUser($account, $attributes = array()) {
  $cas_name = is_object($account) ? $account->cas_name : $account;
  $cas_user = array(
    'name' => $cas_name,
    'attributes' => $attributes,
  );
  variable_set('cas_test_cas_user', $cas_user);
  return $cas_name;
}