You are here

protected function LayoutBuilderTest::setUp in Drupal 10

Same name in this branch
  1. 10 core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::setUp()
  2. 10 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::setUp()
Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::setUp()
  2. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderTest::setUp()

File

core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php, line 59

Class

LayoutBuilderTest
Tests the Layout Builder UI.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->drupalPlaceBlock('local_tasks_block');
  $bundle = BlockContentType::create([
    'id' => 'basic',
    'label' => 'Basic',
  ]);
  $bundle
    ->save();
  block_content_add_body_field($bundle
    ->id());
  BlockContent::create([
    'info' => 'My custom block',
    'type' => 'basic',
    'body' => [
      [
        'value' => 'This is the block content',
        'format' => filter_default_format(),
      ],
    ],
  ])
    ->save();
  $this
    ->createContentType([
    'type' => 'bundle_with_section_field',
  ]);
  $this->node = $this
    ->createNode([
    'type' => 'bundle_with_section_field',
    'title' => 'The node title',
    'body' => [
      [
        'value' => 'The node body',
      ],
    ],
  ]);
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'access contextual links',
    'configure any layout',
    'administer node display',
  ], 'foobar'));
}