function 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 343 
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.
