function KernelTestBase::render

Renders a render array.

Parameters

array $elements: The elements to render.

Return value

string The rendered string output (typically HTML).

File

core/modules/simpletest/src/KernelTestBase.php, line 639

Class

KernelTestBase
Base class for functional integration tests.

Namespace

Drupal\simpletest

Code

protected function render(array &$elements) {
  // Use the bare HTML page renderer to render our links.
  $renderer = $this->container
    ->get('bare_html_page_renderer');
  $response = $renderer->renderBarePage($elements, '', 'maintenance_page');
  // Glean the content from the response object.
  $content = $response->getContent();
  $this->setRawContent($content);
  $this->verbose('<pre style="white-space: pre-wrap">' . Html::escape($content));
  return $content;
}

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