protected function KernelTestBase::render in Drupal 8
Same name in this branch
- 8 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\KernelTestBase::render()
- 8 core/modules/simpletest/src/KernelTestBase.php \Drupal\simpletest\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\simpletestCode
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;
}