You are here

public function LayoutSectionTest::testLayoutDeletingBundle in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php \Drupal\Tests\layout_builder\Functional\LayoutSectionTest::testLayoutDeletingBundle()
  2. 10 core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php \Drupal\Tests\layout_builder\Functional\LayoutSectionTest::testLayoutDeletingBundle()

Tests that deleting a bundle removes the layout.

File

core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php, line 269

Class

LayoutSectionTest
Tests the rendering of a layout section field.

Namespace

Drupal\Tests\layout_builder\Functional

Code

public function testLayoutDeletingBundle() {
  $assert_session = $this
    ->assertSession();
  $display = LayoutBuilderEntityViewDisplay::load('node.bundle_with_section_field.default');
  $this
    ->assertInstanceOf(LayoutBuilderEntityViewDisplay::class, $display);
  $this
    ->drupalPostForm('/admin/structure/types/manage/bundle_with_section_field/delete', [], 'Delete');
  $assert_session
    ->statusCodeEquals(200);
  $display = LayoutBuilderEntityViewDisplay::load('node.bundle_with_section_field.default');
  $this
    ->assertNull($display);
}