function FieldInfoTestCase::testInstanceDisabledEntityType
Test that instances on disabled entity types are filtered out.
File
-
modules/
field/ tests/ field.test, line 1473
Class
Code
function testInstanceDisabledEntityType() {
// For this test the field type and the entity type must be exposed by
// different modules.
$field_definition = array(
'field_name' => 'field',
'type' => 'test_field',
);
field_create_field($field_definition);
$instance_definition = array(
'field_name' => 'field',
'entity_type' => 'comment',
'bundle' => 'comment_node_article',
);
field_create_instance($instance_definition);
// Disable coment module. This clears field_info cache.
module_disable(array(
'comment',
));
$this->assertNull(field_info_instance('comment', 'field', 'comment_node_article'), 'No instances are returned on disabled entity types.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.