You are here

protected function InlineBlockTestBase::createBlockContentType in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php \Drupal\Tests\layout_builder\FunctionalJavascript\InlineBlockTestBase::createBlockContentType()

Creates a block content type.

Parameters

string $id: The block type id.

string $label: The block type label.

2 calls to InlineBlockTestBase::createBlockContentType()
InlineBlockTest::testAddWorkFlow in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php
Tests the workflow for adding an inline block depending on number of types.
InlineBlockTestBase::setUp in core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php

File

core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php, line 208

Class

InlineBlockTestBase
Base class for testing inline blocks.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function createBlockContentType($id, $label) {
  $bundle = BlockContentType::create([
    'id' => $id,
    'label' => $label,
    'revision' => 1,
  ]);
  $bundle
    ->save();
  block_content_add_body_field($bundle
    ->id());
}