protected function RenderElementTypesTest::assertElements in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php \Drupal\KernelTests\Core\Render\Element\RenderElementTypesTest::assertElements()
- 9 core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php \Drupal\KernelTests\Core\Render\Element\RenderElementTypesTest::assertElements()
Asserts that an array of elements is rendered properly.
@internal
Parameters
array $elements: The render element array to test.
string $expected_html: The expected markup.
string $message: Assertion message.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Render/ Element/ RenderElementTypesTest.php, line 40
Class
- RenderElementTypesTest
- Tests the rendered markup of core render element types.
Namespace
Drupal\KernelTests\Core\Render\ElementCode
protected function assertElements(array $elements, string $expected_html, string $message) : void {
$actual_html = (string) \Drupal::service('renderer')
->renderRoot($elements);
$this
->assertSame($expected_html, $actual_html, Html::escape($message));
}