You are here

function CasAttributesTestCase::setUp in CAS Attributes 7

Same name and namespace in other branches
  1. 6.3 cas_attributes.test \CasAttributesTestCase::setUp()

Helper class for CAS tests.

Creates an administrative user and downloads phpCAS.

Overrides CasAttributesTestHelper::setUp

File

./cas_attributes.test, line 70
Tests for CAS Attributes.

Class

CasAttributesTestCase
Test case for CAS attribute setting.

Code

function setUp() {
  parent::setUp();
  foreach (array(
    'test_user_memberof',
    'test_user_name',
  ) as $field_name) {

    // Create a field, and an instance on 'user' entity type.
    $field = array(
      'field_name' => $field_name,
      'type' => 'text',
      'settings' => array(
        'max_length' => 255,
      ),
    );
    field_create_field($field);
    $instance = array(
      'field_name' => $field_name,
      'label' => t('Some user field called @field_name', array(
        '@field_name' => $field_name,
      )),
      'entity_type' => 'user',
      'bundle' => 'user',
    );
    field_create_instance($instance);
  }
}