You are here

public function RendererPlaceholdersTest::testChildrenPlusBuilder in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RendererPlaceholdersTest::testChildrenPlusBuilder()

@covers ::render @covers ::doRender

@expectedException \DomainException @expectedExceptionMessage 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.

File

core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php, line 888
Contains \Drupal\Tests\Core\Render\RendererPlaceholdersTest.

Class

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

Namespace

Drupal\Tests\Core\Render

Code

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->renderer
    ->renderRoot($element);
}