Commit 422bf9b0 authored by alexpott's avatar alexpott

Issue #1952652 by andypost: [Follow up] Instance components are not removed...

Issue #1952652 by andypost: [Follow up] Instance components are not removed from entity display when the field/instance is deleted.
parent 38ffd7a1
......@@ -233,17 +233,17 @@ public function testDeleteFieldInstance() {
$this->enableModules(array('field_sql_storage', 'field_test'));
// Create a field and an instance.
$field = array(
$field = entity_create('field_entity', array(
'field_name' => 'test_field',
'type' => 'test_field'
);
field_create_field($field);
$instance = array(
));
$field->save();
$instance = entity_create('field_instance', array(
'field_name' => $field['field_name'],
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
);
field_create_instance($instance);
));
$instance->save();
// Create an entity display.
$display = entity_create('entity_display', array(
......@@ -253,8 +253,7 @@ public function testDeleteFieldInstance() {
))->setComponent($field['field_name'])->save();
// Delete the instance.
$instance = field_info_instance('entity_test', $field['field_name'], 'entity_test');
field_delete_instance($instance);
$instance->delete();
// Check that the component has been removed from the entity display.
$display = entity_get_display('entity_test', 'entity_test', 'default');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment