function SectionStorageTestBase::assertSections

Asserts that the field list has the expected sections.

Parameters

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

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

... See full list

File

core/modules/layout_builder/tests/src/Kernel/SectionStorageTestBase.php, line 197

Class

SectionStorageTestBase
Provides a base class for testing implementations of section storage.

Namespace

Drupal\Tests\layout_builder\Kernel

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.