You are here

public function RenderTest::testRenderChildren in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Render/RenderTest.php \Drupal\KernelTests\Core\Render\RenderTest::testRenderChildren()
  2. 9 core/tests/Drupal/KernelTests/Core/Render/RenderTest.php \Drupal\KernelTests\Core\Render\RenderTest::testRenderChildren()

Ensures that render array children are processed correctly.

File

core/tests/Drupal/KernelTests/Core/Render/RenderTest.php, line 49

Class

RenderTest
Performs functional tests on \Drupal::service('renderer')->render().

Namespace

Drupal\KernelTests\Core\Render

Code

public function testRenderChildren() {

  // Ensure that #prefix and #suffix is only being printed once since that is
  // the behavior the caller code expects.
  $build = [
    '#type' => 'container',
    '#theme' => 'theme_test_render_element_children',
    '#prefix' => 'kangaroo',
    '#suffix' => 'kitten',
  ];
  $this
    ->render($build);
  $this
    ->removeWhiteSpace();
  $this
    ->assertNoRaw('<div>kangarookitten</div>');
}