$this->
assertSession()->
pageTextContains('Template matching the specific theme call.'
);
$this->
assertSession()->
pageTextContains('theme_test_specific_suggestions__variant'
);
// Ensure that the base hook is used to determine the suggestion alter hook.
\Drupal::
service('module_installer'
)->
install(['theme_suggestions_test'
]);
$this->
resetAll();
$this->
drupalGet('theme-test/specific-suggestion-alter'
);
$this->
assertSession()->
pageTextContains('Template overridden based on suggestion alter hook determined by the base hook.'
);
$raw_content =
$this->
getSession()->
getPage()->
getContent();
// Verify that a specific theme call is added to the suggestions array
// before the suggestions alter hook.
$this->
assertLessThan(strpos($raw_content, 'theme_test_specific_suggestions__variant__foo'
),
strpos($raw_content, 'theme_test_specific_suggestions__variant'
));
} /**
* Tests execution order of theme suggestion alter hooks.
*
* Hook hook_theme_suggestions_alter() should fire before
* hook_theme_suggestions_HOOK_alter() within an extension (module or theme).
*/
public function testExecutionOrder() { // Install our test theme and module.
$this->
config('system.theme'
)