function LayoutBuilderEntityViewDisplayTest::getSectionList

Same name and namespace in other branches
  1. 10 core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Kernel\LayoutBuilderEntityViewDisplayTest::getSectionList()
  2. 11.x core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Kernel\LayoutBuilderEntityViewDisplayTest::getSectionList()

Overrides SectionListTestBase::getSectionList

File

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

Class

LayoutBuilderEntityViewDisplayTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21layout_builder%21src%21Entity%21LayoutBuilderEntityViewDisplay.php/class/LayoutBuilderEntityViewDisplay/9" title="Provides an entity view display entity that has a layout." class="local">\Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay</a>

Namespace

Drupal\Tests\layout_builder\Kernel

Code

protected function getSectionList(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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.