diff --git a/core/modules/views/src/Tests/ViewsThemeIntegrationTest.php b/core/modules/views/src/Tests/ViewsThemeIntegrationTest.php index e368c84..3b0e14f 100644 --- a/core/modules/views/src/Tests/ViewsThemeIntegrationTest.php +++ b/core/modules/views/src/Tests/ViewsThemeIntegrationTest.php @@ -81,4 +81,29 @@ public function testThemedViewPage() { $this->assertRaw("test_basetheme_views_post_render", "Views title changed by test_basetheme.test_basetheme_views_post_render"); } + /** + * Tests the views theme suggestions in debug mode. + */ + public function testThemeSuggestionsInDebug() { + $parameters = $this->container->getParameter('twig.config'); + $parameters['debug'] = TRUE; + $this->setContainerParameter('twig.config', $parameters); + $this->rebuildContainer(); + $this->resetAll(); + + $build = [ + '#type' => 'view', + '#name' => 'test_page_display', + '#display_id' => 'default', + '#arguments' => array(), + ]; + + $output = drupal_render($build, TRUE); + + $this->assertTrue(strpos($output, '* views-view--test-page-display--default.html.twig') !== FALSE); + $this->assertTrue(strpos($output, '* views-view--default.html.twig') !== FALSE); + $this->assertTrue(strpos($output, '* views-view--test-page-display.html.twig') !== FALSE); + $this->assertTrue(strpos($output, 'x views-view.html.twig') !== FALSE); + } + }