function FormsArbitraryRebuildTestCase::setUp

Overrides DrupalWebTestCase::setUp

File

modules/simpletest/tests/form.test, line 2009

Class

FormsArbitraryRebuildTestCase
Tests rebuilding of arbitrary forms by altering them.

Code

function setUp() {
    parent::setUp('form_test');
    // Auto-create a field for testing.
    $field = array(
        'field_name' => 'test_multiple',
        'type' => 'text',
        'cardinality' => -1,
        'translatable' => FALSE,
    );
    field_create_field($field);
    $instance = array(
        'entity_type' => 'node',
        'field_name' => 'test_multiple',
        'bundle' => 'page',
        'label' => 'Test a multiple valued field',
        'widget' => array(
            'type' => 'text_textfield',
            'weight' => 0,
        ),
    );
    field_create_instance($instance);
    variable_set('user_register', USER_REGISTER_VISITORS);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.