You are here

protected function LayoutBuilderEntityViewDisplayTest::getSectionStorage in Drupal 8

Sets up the section storage entity.

Parameters

array $section_data: An array of section data.

Return value

\Drupal\Core\Entity\EntityInterface The entity.

Overrides SectionStorageTestBase::getSectionStorage

File

core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php, line 19

Class

LayoutBuilderEntityViewDisplayTest
@coversDefaultClass \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay

Namespace

Drupal\Tests\layout_builder\Kernel

Code

protected function getSectionStorage(array $section_data) {
  $display = LayoutBuilderEntityViewDisplay::create([
    'targetEntityType' => 'entity_test',
    'bundle' => 'entity_test',
    'mode' => 'default',
    'status' => TRUE,
    'third_party_settings' => [
      'layout_builder' => [
        'enabled' => TRUE,
        'sections' => $section_data,
      ],
    ],
  ]);
  $display
    ->save();
  return $display;
}