function RendererPlaceholdersTest::testCreatePlaceholderPropertyWithoutLazyBuilder

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RendererPlaceholdersTest::testCreatePlaceholderPropertyWithoutLazyBuilder()
  2. 9 core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RendererPlaceholdersTest::testCreatePlaceholderPropertyWithoutLazyBuilder()
  3. 8.9.x core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php \Drupal\Tests\Core\Render\RendererPlaceholdersTest::testCreatePlaceholderPropertyWithoutLazyBuilder()

Tests create placeholder property without lazy builder.

@legacy-covers ::render @legacy-covers ::doRender

File

core/tests/Drupal/Tests/Core/Render/RendererPlaceholdersTest.php, line 954

Class

RendererPlaceholdersTest
Tests Drupal\Core\Render\Renderer.

Namespace

Drupal\Tests\Core\Render

Code

public function testCreatePlaceholderPropertyWithoutLazyBuilder() : void {
  $element = [];
  $element['#create_placeholder'] = TRUE;
  $this->expectException(\LogicException::class);
  $this->expectExceptionMessage('When #create_placeholder is set, a #lazy_builder callback must be present as well.');
  $this->renderer
    ->renderRoot($element);
}

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