function RendererPlaceholdersTest::testInvalidLazyBuilderArguments
@covers ::render
      
    
@covers ::doRender
      
    
File
- 
              core/
tests/ Drupal/ Tests/ Core/ Render/ RendererPlaceholdersTest.php, line 868  
Class
- RendererPlaceholdersTest
 - @coversDefaultClass \Drupal\Core\Render\Renderer[[api-linebreak]] @covers \Drupal\Core\Render\RenderCache[[api-linebreak]] @covers \Drupal\Core\Render\PlaceholderingRenderCache[[api-linebreak]] @group Render
 
Namespace
Drupal\Tests\Core\RenderCode
public function testInvalidLazyBuilderArguments() {
  $element = [];
  $element['#lazy_builder'] = [
    '\\Drupal\\Tests\\Core\\Render\\PlaceholdersTest::callback',
    'arg1',
    'arg2',
  ];
  $this->expectException(\AssertionError::class);
  $this->expectExceptionMessage('The #lazy_builder property must have an array as a value, containing two values: the callback, and the arguments for the callback.');
  $this->renderer
    ->renderRoot($element);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.