function ThemeHookCollectorPassTest::testExceptionRemove
Test exception with remove attribute.
RemoveHook attribute is not allowed.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Hook/ ThemeHookCollectorPassTest.php, line 110
Class
Namespace
Drupal\KernelTests\Core\HookCode
public function testExceptionRemove() : void {
$this->expectException(\LogicException::class);
$container = new ContainerBuilder();
$theme_filenames = [
'oop_hook_theme_with_remove' => [
'pathname' => 'core/modules/system/tests/themes/HookCollector/oop_hook_theme_with_remove/oop_hook_theme_with_remove.info.yml',
],
];
$container->setParameter('container.themes', $theme_filenames);
$container->setParameter('preprocess_for_suggestions', []);
$container->setDefinition('theme.manager', new Definition());
(new ThemeHookCollectorPass())->process($container);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.