public function RenderTest::testProcessAttached in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Render/RenderTest.php \Drupal\KernelTests\Core\Render\RenderTest::testProcessAttached()
- 9 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() {
// 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');
}