function FieldMultipleLimitTestCase::addTestFieldToPage in Field multiple limit 7
Set up a text field on the page content type so we can configure it.
See also
1 call to FieldMultipleLimitTestCase::addTestFieldToPage()
- FieldMultipleLimitTestCase::setUp in ./
field_multiple_limit.test - Sets up a Drupal site for running functional and integration tests.
File
- ./
field_multiple_limit.test, line 37 - Tests for Field Multiple Limit, based on examples from field.test
Class
- FieldMultipleLimitTestCase
- Test the field formatter settings work.
Code
function addTestFieldToPage() {
$this->entity_type = 'node';
$this->field_name = 'field_2';
$this->bundle = 'page';
$this->field = array(
'field_name' => $this->field_name,
'type' => 'text',
'cardinality' => 5,
);
$this->field_definition = field_create_field($this->field);
$this->instance_definition = array(
'field_name' => $this->field_name,
'entity_type' => $this->entity_type,
'bundle' => $this->bundle,
);
field_create_instance($this->instance_definition);
}