function RendererRecursionTest::setUpRenderRecursionComplexElements

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php \Drupal\Tests\Core\Render\RendererRecursionTest::setUpRenderRecursionComplexElements()
  2. 10 core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php \Drupal\Tests\Core\Render\RendererRecursionTest::setUpRenderRecursionComplexElements()
  3. 11.x core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php \Drupal\Tests\Core\Render\RendererRecursionTest::setUpRenderRecursionComplexElements()
3 calls to RendererRecursionTest::setUpRenderRecursionComplexElements()
RendererRecursionTest::testRenderRecursionWithNestedRender in core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php
::render() may be called from anywhere.
RendererRecursionTest::testRenderRecursionWithNestedRenderPlain in core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php
::renderPlain() may be called from anywhere.
RendererRecursionTest::testRenderRecursionWithNestedRenderRoot in core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php
::renderRoot() may not be called inside of another ::renderRoot() call.

File

core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php, line 11

Class

RendererRecursionTest
@coversDefaultClass \Drupal\Core\Render\Renderer @group Render

Namespace

Drupal\Tests\Core\Render

Code

protected function setUpRenderRecursionComplexElements() {
    $complex_child_markup = '<p>Imagine this is a render array for an entity.</p>';
    $parent_markup = '<p>Rendered!</p>';
    $complex_child_template = [
        '#cache' => [
            'tags' => [
                'test:complex_child',
            ],
        ],
        '#lazy_builder' => [
            'Drupal\\Tests\\Core\\Render\\PlaceholdersTest::callback',
            [
                $this->getRandomGenerator()
                    ->string(),
            ],
        ],
        '#create_placeholder' => TRUE,
    ];
    return [
        $complex_child_markup,
        $parent_markup,
        $complex_child_template,
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.