function ThemeHookCollectorPassTest::testHookExecution
Tests hook execution in themes.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Hook/ ThemeHookCollectorPassTest.php, line 127
Class
Namespace
Drupal\KernelTests\Core\HookCode
public function testHookExecution() : void {
$this->container
->get('theme_installer')
->install([
'oop_hook_theme',
]);
$theme_manager = $this->container
->get('theme.manager');
$theme_manager->setActiveTheme(\Drupal::service('theme.initialization')->initTheme('oop_hook_theme'));
$expected_calls = [
'Drupal\\oop_hook_theme\\Hook\\TestHookCollectionHooks::testHookAlter',
];
$hooks = 'test_hook';
$calls = [];
$theme_manager->alter($hooks, $calls);
$this->assertEquals($expected_calls, $calls);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.