class TestSectionList
Same name and namespace in other branches
- 11.x core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php \Drupal\Tests\layout_builder\Kernel\TestSectionList
Hierarchy
- class \Drupal\Tests\layout_builder\Kernel\TestSectionList extends \Drupal\layout_builder\SectionListInterface uses \Drupal\layout_builder\SectionListTrait
Expanded class hierarchy of TestSectionList
File
-
core/
modules/ layout_builder/ tests/ src/ Kernel/ SectionListTraitTest.php, line 34
Namespace
Drupal\Tests\layout_builder\KernelView source
class TestSectionList implements SectionListInterface {
use SectionListTrait {
addBlankSection as public;
}
/**
* An array of sections.
*
* @var \Drupal\layout_builder\Section[]
*/
protected $sections;
/**
* TestSectionList constructor.
*/
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());
}
}
/**
* {@inheritdoc}
*/
protected function setSections(array $sections) {
$this->sections = array_values($sections);
return $sections;
}
/**
* {@inheritdoc}
*/
public function getSections() {
return $this->sections;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.