function RenderTest::testRenderChildren

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Render/RenderTest.php \Drupal\KernelTests\Core\Render\RenderTest::testRenderChildren()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Render/RenderTest.php \Drupal\KernelTests\Core\Render\RenderTest::testRenderChildren()
  3. 11.x 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() : void {
    // 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>');
}

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