You are here

protected function RendererRecursionTest::setUpRenderRecursionComplexElements in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 18
Contains \Drupal\Tests\Core\Render\RendererRecursionTest.

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,
  ];
}