You are here

public function TestSectionList::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php \Drupal\Tests\layout_builder\Kernel\TestSectionList::__construct()
  2. 10 core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php \Drupal\Tests\layout_builder\Kernel\TestSectionList::__construct()

TestSectionList constructor.

File

core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php, line 50

Class

TestSectionList

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function __construct(array $sections) {

  // Loop through each section and reconstruct it to ensure that all default
  // values are present.
  foreach ($sections as $section) {
    $this->sections[] = Section::fromArray($section
      ->toArray());
  }
}