You are here

protected function TestSectionList::setSections 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::setSections()
  2. 10 core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php \Drupal\Tests\layout_builder\Kernel\TestSectionList::setSections()

Stores the information for all sections.

Implementations of this method are expected to call array_values() to rekey the list of sections.

Parameters

\Drupal\layout_builder\Section[] $sections: An array of section objects.

Return value

$this

Overrides SectionListTrait::setSections

File

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

Class

TestSectionList

Namespace

Drupal\Tests\layout_builder\Kernel

Code

protected function setSections(array $sections) {
  $this->sections = array_values($sections);
  return $sections;
}