You are here

protected function RendererRecursionTest::setUpRenderRecursionComplexElements in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Render/RendererRecursionTest.php \Drupal\Tests\Core\Render\RendererRecursionTest::setUpRenderRecursionComplexElements()
  2. 9 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,
  ];
}