diff --git a/core/modules/system/src/Tests/Common/RenderTest.php b/core/modules/system/src/Tests/Common/RenderTest.php index b10240d..94ad431 100644 --- a/core/modules/system/src/Tests/Common/RenderTest.php +++ b/core/modules/system/src/Tests/Common/RenderTest.php @@ -53,21 +53,17 @@ function testDrupalRenderThemePreprocessAttached() { } /** - * Tests drupal_process_attached(). + * Tests that we get an exception when we try to attach an illegal type. */ public function testDrupalProcessAttached() { // Specify invalid attachments in a render array. $build['#attached']['library'][] = 'core/drupal.states'; $build['#attached']['drupal_process_states'][] = []; try { - // Use the bare HTML page renderer to render our attachments. - $renderer = $this->container->get('bare_html_page_renderer'); - $response = $renderer->renderBarePage( - $build, '', $this->container->get('theme.manager')->getActiveTheme()->getName() - ); + $this->render($build); $this->fail("Invalid #attachment 'drupal_process_states' allowed"); } - catch (\Exception $e) { + catch (\LogicException $e) { $this->pass("Invalid #attachment 'drupal_process_states' not allowed"); } }