function LazyBuilderPlaceholderTest::testNestedLazyBuilderPlaceholders
Tests Fiber::suspend() during twig rendering via placeholders.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Render/ LazyBuilderPlaceholderTest.php, line 33
Class
- LazyBuilderPlaceholderTest
- Tests Fiber suspension within Twig templates during placeholder rendering.
Namespace
Drupal\KernelTests\Core\RenderCode
public function testNestedLazyBuilderPlaceholders() : void {
$render_array = $this->buildRenderArray();
$output_string = (string) \Drupal::service('renderer')->renderRoot($render_array);
$items = [
'<div>Lazy builder content with param1</div>',
'First Fibers test: param2',
'Second Fibers test: param2',
'<div>Lazy builder content with param3</div>',
'First Fibers test: param4',
'Second Fibers test: param4',
];
$this->assertStringOrder($items, $output_string);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.