function ComponentRenderTest::checkEmptyProps
Same name in this branch
- 11.x core/modules/sdc/tests/src/Kernel/ComponentRenderTest.php \Drupal\Tests\sdc\Kernel\ComponentRenderTest::checkEmptyProps()
Same name in other branches
- 10 core/modules/sdc/tests/src/Kernel/ComponentRenderTest.php \Drupal\Tests\sdc\Kernel\ComponentRenderTest::checkEmptyProps()
- 10 core/tests/Drupal/KernelTests/Components/ComponentRenderTest.php \Drupal\KernelTests\Components\ComponentRenderTest::checkEmptyProps()
Ensure that components can have 0 props.
1 call to ComponentRenderTest::checkEmptyProps()
- ComponentRenderTest::testRender in core/
tests/ Drupal/ KernelTests/ Components/ ComponentRenderTest.php - Test that components render correctly.
File
-
core/
tests/ Drupal/ KernelTests/ Components/ ComponentRenderTest.php, line 342
Class
- ComponentRenderTest
- Tests the correct rendering of components.
Namespace
Drupal\KernelTests\ComponentsCode
public function checkEmptyProps() : void {
$build = [
'#type' => 'component',
'#component' => 'sdc_test:no-props',
'#props' => [],
];
$crawler = $this->renderComponentRenderArray($build);
$this->assertEquals($crawler->filter('#sdc-wrapper')
->innerText(), 'This is a test string.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.