function RendererPlaceholdersTest::testChildrenPlusBuilder
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RendererPlaceholdersTest::testChildrenPlusBuilder()
- 10 core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RendererPlaceholdersTest::testChildrenPlusBuilder()
- 11.x core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RendererPlaceholdersTest::testChildrenPlusBuilder()
@covers ::render @covers ::doRender
File
-
core/
tests/ Drupal/ Tests/ Core/ Render/ RendererPlaceholdersTest.php, line 926
Class
- RendererPlaceholdersTest
- @coversDefaultClass \Drupal\Core\Render\Renderer @covers \Drupal\Core\Render\RenderCache @covers \Drupal\Core\Render\PlaceholderingRenderCache @group Render
Namespace
Drupal\Tests\Core\RenderCode
public function testChildrenPlusBuilder() {
$element = [];
$element['#lazy_builder'] = [
'Drupal\\Tests\\Core\\Render\\RecursivePlaceholdersTest::callback',
[],
];
$element['child_a']['#markup'] = 'Oh hai!';
$element['child_b']['#markup'] = 'kthxbai';
$this->expectException(\DomainException::class);
$this->expectExceptionMessage('When a #lazy_builder callback is specified, no children can exist; all children must be generated by the #lazy_builder callback. You specified the following children: child_a, child_b.');
$this->renderer
->renderRoot($element);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.