function LayoutBuilderEntityViewDisplayTest::getSectionList
Sets up the section list.
Parameters
array $section_data: An array of section data.
Return value
\Drupal\layout_builder\SectionListInterface The section list.
Overrides SectionListTestBase::getSectionList
File
- 
              core/
modules/ layout_builder/ tests/ src/ Kernel/ LayoutBuilderEntityViewDisplayTest.php, line 21  
Class
- LayoutBuilderEntityViewDisplayTest
 - @coversDefaultClass \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay[[api-linebreak]]
 
Namespace
Drupal\Tests\layout_builder\KernelCode
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.