summaryrefslogtreecommitdiff
path: root/modules/field/tests
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-07 05:12:35 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-07 05:12:35 +0000
commit73c28090e36e2ade9c055f7da58767e57d935898 (patch)
treebb6efe15e2c868c65df37adb4859e4a630c82b1c /modules/field/tests
parent3729441ace1f10b5f37079a7dfcf9f7f26156213 (diff)
downloadbrdo-73c28090e36e2ade9c055f7da58767e57d935898.tar.gz
brdo-73c28090e36e2ade9c055f7da58767e57d935898.tar.bz2
#668386 by yched: Handle unavailable entity types or bundles.
Diffstat (limited to 'modules/field/tests')
-rw-r--r--modules/field/tests/field.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test
index 3cfd3f797..ca503002f 100644
--- a/modules/field/tests/field.test
+++ b/modules/field/tests/field.test
@@ -1348,6 +1348,29 @@ class FieldInfoTestCase extends FieldTestCase {
}
/**
+ * Test that instances on disabled object types are filtered out.
+ */
+ function testInstanceDisabledObjectType() {
+ // For this test the field type and the object 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',
+ 'object_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'), t('No instances are returned on disabled object types.'));
+ }
+
+ /**
* Test that the field_info settings convenience functions work.
*/
function testSettingsInfo() {