You are here

protected function KernelTestBase::render in SimpleTest 8.3

Renders a render array.

Parameters

array $elements: The elements to render.

Return value

string The rendered string output (typically HTML).

File

src/KernelTestBase.php, line 633

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;
}