You are here

protected function SectionListTestBase::assertSections in Drupal 9

Same name and namespace in other branches
  1. 10 core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php \Drupal\Tests\layout_builder\Kernel\SectionListTestBase::assertSections()

Asserts that the field list has the expected sections.

Parameters

\Drupal\layout_builder\Section[] $expected: The expected sections.

6 calls to SectionListTestBase::assertSections()
SectionListTestBase::testAppendSection in core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php
@covers ::appendSection
SectionListTestBase::testGetSections in core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php
Tests ::getSections().
SectionListTestBase::testInsertSection in core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php
@covers ::insertSection
SectionListTestBase::testRemoveAllSections in core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php
@covers ::removeAllSections
SectionListTestBase::testRemoveMultipleSections in core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php
@covers ::removeSection

... See full list

File

core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php, line 195

Class

SectionListTestBase
Provides a base class for testing implementations of a section list.

Namespace

Drupal\Tests\layout_builder\Kernel

Code

protected function assertSections(array $expected) {
  $result = $this->sectionList
    ->getSections();
  $this
    ->assertEquals($expected, $result);
  $this
    ->assertSame(array_keys($expected), array_keys($result));
}