You are here

function CasRolesTestCase::setUp in CAS roles 7.2

Same name and namespace in other branches
  1. 7 cas_roles.test \CasRolesTestCase::setUp()

Helper class for CAS tests.

Creates an administrative user and downloads phpCAS.

Overrides CasTestHelper::setUp

File

./cas_roles.test, line 18
Tests for CAS roles.

Class

CasRolesTestCase
Test case for CAS attribute setting.

Code

function setUp() {
  $modules = func_get_args();
  if (isset($modules[0]) && is_array($modules[0])) {
    $modules = $modules[0];
  }
  $modules = array_merge(array(
    'cas_attributes',
    'cas_roles',
  ), $modules);
  parent::setUp($modules);

  // Set up the roles.
  $this->roles['teacher'] = $this
    ->drupalCreateRole(array(), 'teacher');
  $this->roles['student'] = $this
    ->drupalCreateRole(array(), 'student');
  $this->roles['philosopher'] = $this
    ->drupalCreateRole(array(), 'philosopher');
  $this->roles['staff'] = $this
    ->drupalCreateRole(array(), 'staff');
}