class TestSectionList in Drupal 8
Same name and namespace in other branches
- 9 core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php \Drupal\Tests\layout_builder\Kernel\TestSectionList
- 10 core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php \Drupal\Tests\layout_builder\Kernel\TestSectionList
Hierarchy
- class \Drupal\Tests\layout_builder\Kernel\TestSectionList implements SectionListInterface uses SectionStorageTrait
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 SectionStorageTrait {
    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;
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| SectionStorageTrait:: | protected | function | Adds a blank section to the list. | |
| SectionStorageTrait:: | public | function | ||
| SectionStorageTrait:: | public | function | ||
| SectionStorageTrait:: | public | function | ||
| SectionStorageTrait:: | protected | function | Indicates if this section list contains a blank section. | |
| SectionStorageTrait:: | protected | function | Indicates if there is a section at the specified delta. | |
| SectionStorageTrait:: | public | function | ||
| SectionStorageTrait:: | public | function | ||
| SectionStorageTrait:: | public | function | ||
| SectionStorageTrait:: | protected | function | Sets the section for the given delta on the display. | |
| SectionStorageTrait:: | public | function | Magic method: Implements a deep clone. | |
| TestSectionList:: | protected | property | An array of sections. | |
| TestSectionList:: | public | function | Gets the layout sections. Overrides SectionListInterface:: | |
| TestSectionList:: | protected | function | Stores the information for all sections. Overrides SectionStorageTrait:: | |
| TestSectionList:: | public | function | TestSectionList constructor. | 
