You are here

function FieldCrudTestCase::testReadField in Drupal 7

Test reading back a field definition.

File

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

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.');
}