function ViewsTemplateTest::testThemeSuggestionsContainerAlter
Same name in other branches
- 10 core/modules/views/tests/src/Kernel/ViewsTemplateTest.php \Drupal\Tests\views\Kernel\ViewsTemplateTest::testThemeSuggestionsContainerAlter()
- 11.x core/modules/views/tests/src/Kernel/ViewsTemplateTest.php \Drupal\Tests\views\Kernel\ViewsTemplateTest::testThemeSuggestionsContainerAlter()
@covers views_theme_suggestions_container_alter().
Throws
\Exception
File
-
core/
modules/ views/ tests/ src/ Kernel/ ViewsTemplateTest.php, line 49
Class
- ViewsTemplateTest
- Tests the template retrieval of views.
Namespace
Drupal\Tests\views\KernelCode
public function testThemeSuggestionsContainerAlter() {
$build = [
'#type' => 'view',
'#name' => 'test_page_display',
'#display_id' => 'default',
'#arguments' => [],
];
$output = $this->render($build);
$extension = '.html.twig';
$expected = '<!-- FILE NAME SUGGESTIONS:' . PHP_EOL . ' * container--more-link--test-page-display--default' . $extension . PHP_EOL . ' * container--more-link--default' . $extension . PHP_EOL . ' * container--more-link--test-page-display' . $extension . PHP_EOL . ' * container--more-link' . $extension . PHP_EOL . ' x container' . $extension . PHP_EOL . '-->' . PHP_EOL;
$this->assertStringContainsString($expected, $output, 'Views more link container suggestions found in Twig debug output');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.