You are here

protected function InlineBlockTitleAutomaticTest::setUp in Inline Block Title Automatic 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/InlineBlockTitleAutomaticTest.php, line 54

Class

InlineBlockTitleAutomaticTest
Test the inline block automatic module.

Namespace

Drupal\Tests\inline_block_title_automatic\Functional

Code

protected function setUp() {
  parent::setUp();
  NodeType::create([
    'type' => 'example',
    'label' => 'Example',
  ])
    ->save();

  /** @var \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay $display */
  $display = EntityViewDisplay::create([
    'targetEntityType' => 'node',
    'bundle' => 'example',
    'mode' => 'default',
    'status' => TRUE,
  ]);
  $display
    ->enableLayoutBuilder();
  $display
    ->setOverridable();
  $display
    ->save();
  $this->node = Node::create([
    'type' => 'example',
    'title' => 'Foo',
  ]);
  $this->node->layout_builder__layout
    ->appendSection(new Section('layout_onecol'));
  $this->node
    ->save();
  BlockContentType::create([
    'id' => 'rich_text',
    'label' => 'Rich Text',
  ])
    ->save();
  $this->reusableBlock = BlockContent::create([
    'info' => 'Reusable!',
    'type' => 'rich_text',
  ]);
  $this->reusableBlock
    ->setReusable();
  $this->reusableBlock
    ->save();
  $this
    ->drupalLogin($this->rootUser);
}