function LayoutBuilderThemeSuggestionsTest::setUp

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

Overrides BrowserTestBase::setUp

File

core/modules/layout_builder/tests/src/Functional/LayoutBuilderThemeSuggestionsTest.php, line 31

Class

LayoutBuilderThemeSuggestionsTest
Tests template suggestions.

Namespace

Drupal\Tests\layout_builder\Functional

Code

protected function setUp() {
    parent::setUp();
    $this->createContentType([
        'type' => 'bundle_with_section_field',
        'name' => 'Bundle with section field',
    ]);
    $this->createNode([
        'type' => 'bundle_with_section_field',
        'title' => 'A node title',
        'body' => [
            [
                'value' => 'This is content that the template should not render',
            ],
        ],
    ]);
    $this->drupalLogin($this->drupalCreateUser([
        'configure any layout',
        'administer node display',
    ]));
    $this->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');
    $this->drupalPostForm(NULL, [
        'layout[enabled]' => TRUE,
    ], 'Save');
}

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