function LayoutSectionTest::setUp

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php \Drupal\Tests\layout_builder\Functional\LayoutSectionTest::setUp()
  2. 8.9.x core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php \Drupal\Tests\layout_builder\Functional\LayoutSectionTest::setUp()
  3. 11.x core/modules/layout_builder/tests/src/Functional/LayoutSectionTest.php \Drupal\Tests\layout_builder\Functional\LayoutSectionTest::setUp()

Overrides BrowserTestBase::setUp

File

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

Class

LayoutSectionTest
Tests the rendering of a layout section field.

Namespace

Drupal\Tests\layout_builder\Functional

Code

protected function setUp() : void {
    parent::setUp();
    $this->createContentType([
        'type' => 'bundle_without_section_field',
    ]);
    $this->createContentType([
        'type' => 'bundle_with_section_field',
    ]);
    LayoutBuilderEntityViewDisplay::load('node.bundle_with_section_field.default')->enableLayoutBuilder()
        ->setOverridable()
        ->save();
    $this->drupalLogin($this->drupalCreateUser([
        'configure any layout',
        'administer node display',
        'administer node fields',
        'administer content types',
    ], 'foobar'));
}

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