You are here

public function RendererTest::testRenderChildrenAccess in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Render/RendererTest.php \Drupal\Tests\Core\Render\RendererTest::testRenderChildrenAccess()
  2. 9 core/tests/Drupal/Tests/Core/Render/RendererTest.php \Drupal\Tests\Core\Render\RendererTest::testRenderChildrenAccess()

Ensures that #access is taken in account when rendering #render_children.

File

core/tests/Drupal/Tests/Core/Render/RendererTest.php, line 703
Contains \Drupal\Tests\Core\Render\RendererTest.

Class

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

Namespace

Drupal\Tests\Core\Render

Code

public function testRenderChildrenAccess() {
  $build = [
    '#access' => FALSE,
    '#render_children' => TRUE,
    'child' => [
      '#markup' => 'kittens',
    ],
  ];
  $this
    ->assertEquals('', $this->renderer
    ->renderRoot($build));
}