You are here

protected function LayoutBuilderEntityViewDisplayTest::createEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Functional\Jsonapi\LayoutBuilderEntityViewDisplayTest::createEntity()
  2. 9 core/modules/layout_builder/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Functional\Jsonapi\LayoutBuilderEntityViewDisplayTest::createEntity()

Creates the entity to be tested.

Return value

\Drupal\Core\Entity\EntityInterface The entity to be tested.

Overrides EntityViewDisplayTest::createEntity

File

core/modules/layout_builder/tests/src/Functional/Jsonapi/LayoutBuilderEntityViewDisplayTest.php, line 29

Class

LayoutBuilderEntityViewDisplayTest
JSON:API integration test for the "EntityViewDisplay" config entity type.

Namespace

Drupal\Tests\layout_builder\Functional\Jsonapi

Code

protected function createEntity() {

  /** @var \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay $entity */
  $entity = parent::createEntity();
  $entity
    ->enableLayoutBuilder()
    ->setOverridable()
    ->save();
  $this
    ->assertCount(1, $entity
    ->getThirdPartySetting('layout_builder', 'sections'));
  return $entity;
}