function RenderTest::testProcessAttached
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Render/RenderTest.php \Drupal\KernelTests\Core\Render\RenderTest::testProcessAttached()
- 8.9.x core/tests/Drupal/KernelTests/Core/Render/RenderTest.php \Drupal\KernelTests\Core\Render\RenderTest::testProcessAttached()
- 10 core/tests/Drupal/KernelTests/Core/Render/RenderTest.php \Drupal\KernelTests\Core\Render\RenderTest::testProcessAttached()
Tests that we get an exception when we try to attach an illegal type.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Render/ RenderTest.php, line 66
Class
- RenderTest
- Performs functional tests on \Drupal::service('renderer')->render().
Namespace
Drupal\KernelTests\Core\RenderCode
public function testProcessAttached() : void {
// Specify invalid attachments in a render array.
$build['#attached']['library'][] = 'core/drupal.states';
$build['#attached']['drupal_process_states'][] = [];
$renderer = $this->container
->get('bare_html_page_renderer');
$this->expectException(\LogicException::class);
$renderer->renderBarePage($build, '', 'maintenance_page');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.