function LayoutSectionTest::testLayoutDeletingBundle

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()
  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 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);
}

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