function ComponentRenderTest::testRenderEmptyProps
Ensure that components can have 0 props.
File
-
core/
tests/ Drupal/ KernelTests/ Components/ ComponentRenderTest.php, line 324
Class
- ComponentRenderTest
- Tests the correct rendering of components.
Namespace
Drupal\KernelTests\ComponentsCode
public function testRenderEmptyProps() : 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.