You are here

protected function KernelTestBase::render in Zircon Profile 8

Same name in this branch
  1. 8 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::render()
  2. 8 core/modules/simpletest/src/KernelTestBase.php \Drupal\simpletest\KernelTestBase::render()
Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::render()

Renders a render array.

Parameters

array $elements: The elements to render.

Return value

string The rendered string output (typically HTML).

File

core/tests/Drupal/KernelTests/KernelTestBase.php, line 906
Contains \Drupal\KernelTests\KernelTestBase.

Class

KernelTestBase
Base class for functional integration tests.

Namespace

Drupal\KernelTests

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, '', $this->container
    ->get('theme.manager')
    ->getActiveTheme()
    ->getName());

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