function LayoutSectionTest::testLayoutDeletingBundle

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php \Drupal\Tests\layout_builder\Functional\LayoutSectionTest::testLayoutDeletingBundle()
  2. 8.9.x core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php \Drupal\Tests\layout_builder\Functional\LayoutSectionTest::testLayoutDeletingBundle()
  3. 11.x 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 271

Class

LayoutSectionTest
Tests the rendering of a layout section field.

Namespace

Drupal\Tests\layout_builder\Functional

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.