You are here

function FieldFormTestCase::setUp in Drupal 7

Set the default field storage backend for fields created during tests.

Overrides FieldTestCase::setUp

File

modules/field/tests/field.test, line 1616
Tests for field.module.

Class

FieldFormTestCase

Code

function setUp() {
  parent::setUp('field_test');
  $web_user = $this
    ->drupalCreateUser(array(
    'access field_test content',
    'administer field_test content',
  ));
  $this
    ->drupalLogin($web_user);
  $this->field_single = array(
    'field_name' => 'field_single',
    'type' => 'test_field',
  );
  $this->field_multiple = array(
    'field_name' => 'field_multiple',
    'type' => 'test_field',
    'cardinality' => 4,
  );
  $this->field_unlimited = array(
    'field_name' => 'field_unlimited',
    'type' => 'test_field',
    'cardinality' => FIELD_CARDINALITY_UNLIMITED,
  );
  $this->instance = array(
    'entity_type' => 'test_entity',
    'bundle' => 'test_bundle',
    'label' => $this
      ->randomName() . '_label',
    'description' => $this
      ->randomName() . '_description',
    'weight' => mt_rand(0, 127),
    'settings' => array(
      'test_instance_setting' => $this
        ->randomName(),
    ),
    'widget' => array(
      'type' => 'test_field_widget',
      'label' => 'Test Field',
      'settings' => array(
        'test_widget_setting' => $this
          ->randomName(),
      ),
    ),
  );
}