function FieldCrudTestCase::testActive

Test that fields are properly marked active or inactive.

File

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

Class

FieldCrudTestCase

Code

function testActive() {
  $field_definition = array(
    'field_name' => 'field_1',
    'type' => 'test_field',
    // For this test, we need a storage backend provided by a different
    // module than field_test.module.
'storage' => array(
      'type' => 'field_sql_storage',
    ),
  );
  field_create_field($field_definition);
  // Test disabling and enabling:
  // - the field type module,
  // - the storage module,
  // - both.
  $this->_testActiveHelper($field_definition, array(
    'field_test',
  ));
  $this->_testActiveHelper($field_definition, array(
    'field_sql_storage',
  ));
  $this->_testActiveHelper($field_definition, array(
    'field_test',
    'field_sql_storage',
  ));
}

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