You are here

protected function TestAjaxRenderer::drupalRenderRoot in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php \Drupal\Tests\Core\Controller\TestAjaxRenderer::drupalRenderRoot()

Wraps drupal_render_root().

@todo Remove as part of https://www.drupal.org/node/2182149.

Overrides AjaxRenderer::drupalRenderRoot

File

core/tests/Drupal/Tests/Core/Controller/AjaxRendererTest.php, line 88
Contains \Drupal\Tests\Core\Controller\AjaxRendererTest.

Class

TestAjaxRenderer

Namespace

Drupal\Tests\Core\Controller

Code

protected function drupalRenderRoot(&$elements, $is_root_call = FALSE) {
  $elements += [
    '#attached' => [],
  ];
  if (isset($elements['#markup'])) {
    return $elements['#markup'];
  }
  elseif (isset($elements['#type'])) {
    return $elements['#type'];
  }
  else {
    return 'Markup';
  }
}