function AJAXMultiFormTestCase::setUp

Overrides AJAXTestCase::setUp

File

modules/simpletest/tests/ajax.test, line 449

Class

AJAXMultiFormTestCase
Tests that Ajax-enabled forms work when multiple instances of the same form are on a page.

Code

function setUp() {
  parent::setUp(array(
    'form_test',
  ));
  // Create a multi-valued field for 'page' nodes to use for Ajax testing.
  $field_name = 'field_ajax_test';
  $field = array(
    'field_name' => $field_name,
    'type' => 'text',
    'cardinality' => FIELD_CARDINALITY_UNLIMITED,
  );
  field_create_field($field);
  $instance = array(
    'field_name' => $field_name,
    'entity_type' => 'node',
    'bundle' => 'page',
  );
  field_create_instance($instance);
  // Login a user who can create 'page' nodes.
  $this->web_user = $this->drupalCreateUser(array(
    'create page content',
  ));
  $this->drupalLogin($this->web_user);
}

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