public function ThemeTest::testPreprocessForSuggestions in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testPreprocessForSuggestions()
- 9 core/modules/system/tests/src/Functional/Theme/ThemeTest.php \Drupal\Tests\system\Functional\Theme\ThemeTest::testPreprocessForSuggestions()
Ensures preprocess functions run even for suggestion implementations.
The theme hook used by this test has its base preprocess function in a separate file, so this test also ensures that the file is correctly loaded when needed.
File
- core/
modules/ system/ tests/ src/ Functional/ Theme/ ThemeTest.php, line 43
Class
- ThemeTest
- Tests low-level theme functions.
Namespace
Drupal\Tests\system\Functional\ThemeCode
public function testPreprocessForSuggestions() {
// Test with both an unprimed and primed theme registry.
drupal_theme_rebuild();
for ($i = 0; $i < 2; $i++) {
$this
->drupalGet('theme-test/suggestion');
$this
->assertSession()
->pageTextContains('Theme hook implementor=theme-test--suggestion.html.twig. Foo=template_preprocess_theme_test');
}
}