function FieldCrudTestCase::testReadField

Test reading back a field definition.

File

modules/field/tests/field.test, line 2548

Class

FieldCrudTestCase

Code

function testReadField() {
    $field_definition = array(
        'field_name' => 'field_1',
        'type' => 'test_field',
    );
    field_create_field($field_definition);
    // Read the field back.
    $field = field_read_field($field_definition['field_name']);
    $this->assertTrue($field_definition < $field, 'The field was properly read.');
}

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