You are here

function ThemeTest::testDrupalRenderChildren in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Theme/ThemeTest.php \Drupal\system\Tests\Theme\ThemeTest::testDrupalRenderChildren()

Tests child element rendering for 'render element' theme hooks.

File

core/modules/system/src/Tests/Theme/ThemeTest.php, line 238
Contains \Drupal\system\Tests\Theme\ThemeTest.

Class

ThemeTest
Tests low-level theme functions.

Namespace

Drupal\system\Tests\Theme

Code

function testDrupalRenderChildren() {
  $element = array(
    '#theme' => 'theme_test_render_element_children',
    'child' => array(
      '#markup' => 'Foo',
    ),
  );
  $this
    ->assertThemeOutput('theme_test_render_element_children', $element, 'Foo', 'drupal_render() avoids #theme recursion loop when rendering a render element.');
  $element = array(
    '#theme_wrappers' => array(
      'theme_test_render_element_children',
    ),
    'child' => array(
      '#markup' => 'Foo',
    ),
  );
  $this
    ->assertThemeOutput('theme_test_render_element_children', $element, 'Foo', 'drupal_render() avoids #theme_wrappers recursion loop when rendering a render element.');
}