function ModuleImplementsAlterTest::testModuleImplementsAlterNonExistingImplementation
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php \Drupal\KernelTests\Core\Extension\ModuleImplementsAlterTest::testModuleImplementsAlterNonExistingImplementation()
- 8.9.x core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php \Drupal\KernelTests\Core\Extension\ModuleImplementsAlterTest::testModuleImplementsAlterNonExistingImplementation()
Tests adding a non-existing function to hook_module_implements_alter().
See also
\Drupal\Core\Extension\ModuleHandler::buildImplementationInfo()
module_test_module_implements_alter()
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Extension/ ModuleImplementsAlterTest.php, line 74
Class
Namespace
Drupal\KernelTests\Core\ExtensionCode
public function testModuleImplementsAlterNonExistingImplementation() : void {
// Install the module_test module.
\Drupal::service('module_installer')->install([
'module_test',
]);
// Trigger hook discovery.
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('An invalid implementation module_test_unimplemented_test_hook was added by hook_module_implements_alter()');
\Drupal::moduleHandler()->hasImplementations('unimplemented_test_hook');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.