function HookCollectorPassTest::testLegacyModuleImplementsAlter
Test LegacyModuleImplementsAlter.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Hook/ HookCollectorPassTest.php, line 90
Class
- HookCollectorPassTest
- @coversDefaultClass \Drupal\Core\Hook\HookCollectorPass[[api-linebreak]] @group Hook
Namespace
Drupal\KernelTests\Core\HookCode
public function testLegacyModuleImplementsAlter() : void {
$container = new ContainerBuilder();
$module_filenames = [
'module_implements_alter_test_legacy' => [
'pathname' => "core/tests/Drupal/Tests/Core/Extension/modules/module_implements_alter_test_legacy/module_implements_alter_test_legacy.info.yml",
],
];
include_once 'core/tests/Drupal/Tests/Core/Extension/modules/module_implements_alter_test_legacy/module_implements_alter_test_legacy.module';
$container->setParameter('container.modules', $module_filenames);
$container->setDefinition('module_handler', new Definition());
(new HookCollectorPass())->process($container);
// This test will also fail if the deprecation notice shows up.
$this->assertFalse(isset($GLOBALS['ShouldNotRunLegacyModuleImplementsAlter']));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.