public function EntityDisplayTest::testDeleteBundle in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/field_ui/src/Tests/EntityDisplayTest.php \Drupal\field_ui\Tests\EntityDisplayTest::testDeleteBundle()
Tests deleting a bundle.
File
- core/
modules/ field_ui/ src/ Tests/ EntityDisplayTest.php, line 310 - Contains \Drupal\field_ui\Tests\EntityDisplayTest.
Class
- EntityDisplayTest
- Tests the entity display configuration entities.
Namespace
Drupal\field_ui\TestsCode
public function testDeleteBundle() {
// Create a node bundle, display and form display object.
$type = NodeType::create(array(
'type' => 'article',
));
$type
->save();
node_add_body_field($type);
entity_get_display('node', 'article', 'default')
->save();
entity_get_form_display('node', 'article', 'default')
->save();
// Delete the bundle.
$type
->delete();
$display = entity_load('entity_view_display', 'node.article.default');
$this
->assertFalse((bool) $display);
$form_display = entity_load('entity_form_display', 'node.article.default');
$this
->assertFalse((bool) $form_display);
}