3 namespace Drupal\Tests\layout_builder\Kernel;
5 use Drupal\entity_test\Entity\EntityTestBaseFieldDisplay;
6 use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay;
7 use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage;
10 * Tests the field type for Layout Sections.
12 * @coversDefaultClass \Drupal\layout_builder\Field\LayoutSectionItemList
14 * @group layout_builder
16 class LayoutSectionItemListTest extends SectionStorageTestBase {
21 public static $modules = [
29 protected function getSectionStorage(array $section_data) {
30 $this->installEntitySchema('entity_test_base_field_display');
31 LayoutBuilderEntityViewDisplay::create([
32 'targetEntityType' => 'entity_test_base_field_display',
33 'bundle' => 'entity_test_base_field_display',
37 ->enableLayoutBuilder()
41 array_map(function ($row) {
42 return ['section' => $row];
44 $entity = EntityTestBaseFieldDisplay::create([
45 'name' => 'The test entity',
46 OverridesSectionStorage::FIELD_NAME => $section_data,
49 return $entity->get(OverridesSectionStorage::FIELD_NAME);