function SectionTest::assertComponents

Same name and namespace in other branches
  1. 11.x core/modules/layout_builder/tests/src/Unit/SectionTest.php \Drupal\Tests\layout_builder\Unit\SectionTest::assertComponents()
  2. 10 core/modules/layout_builder/tests/src/Unit/SectionTest.php \Drupal\Tests\layout_builder\Unit\SectionTest::assertComponents()
  3. 8.9.x core/modules/layout_builder/tests/src/Unit/SectionTest.php \Drupal\Tests\layout_builder\Unit\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.

File

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

Class

SectionTest
@coversDefaultClass \Drupal\layout_builder\Section[[api-linebreak]] @group layout_builder

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.