function SectionTest::assertComponents

Asserts that the section has the expected components.

@internal

Parameters

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

\Drupal\layout_builder\Section $section: The section storage to check.

6 calls to SectionTest::assertComponents()
SectionTest::testAppendComponent in core/modules/layout_builder/tests/src/Unit/SectionTest.php
Tests append component.
SectionTest::testGetComponents in core/modules/layout_builder/tests/src/Unit/SectionTest.php
Tests get components.
SectionTest::testInsertAfterComponent in core/modules/layout_builder/tests/src/Unit/SectionTest.php
Tests insert after component.
SectionTest::testInsertComponent in core/modules/layout_builder/tests/src/Unit/SectionTest.php
Tests insert component.
SectionTest::testInsertComponentAppend in core/modules/layout_builder/tests/src/Unit/SectionTest.php
Tests insert component append.

... See full list

File

core/modules/layout_builder/tests/src/Unit/SectionTest.php, line 222

Class

SectionTest
Tests Drupal\layout_builder\Section.

Namespace

Drupal\Tests\layout_builder\Unit

Code

protected function assertComponents(array $expected, Section $section) : void {
  $result = $section->getComponents();
  $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.