Skip to content
Snippets Groups Projects
Commit 422bf9b0 authored by Alex Pott's avatar Alex Pott
Browse files

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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment