function SectionListTestBase::assertSections

Same name and namespace in other branches
  1. 11.x core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php \Drupal\Tests\layout_builder\Kernel\SectionListTestBase::assertSections()
  2. 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.

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));
}

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