function ModuleImplementsAlterTest::testModuleImplementsAlterNonExistingImplementation
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php \Drupal\KernelTests\Core\Extension\ModuleImplementsAlterTest::testModuleImplementsAlterNonExistingImplementation()
- 10 core/tests/Drupal/KernelTests/Core/Extension/ModuleImplementsAlterTest.php \Drupal\KernelTests\Core\Extension\ModuleImplementsAlterTest::testModuleImplementsAlterNonExistingImplementation()
Tests what happens if hook_module_implements_alter() adds a non-existing function to the implementations.
See also
\Drupal\Core\Extension\ModuleHandler::buildImplementationInfo()
module_test_module_implements_alter()
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Extension/ ModuleImplementsAlterTest.php, line 75
Class
Namespace
Drupal\KernelTests\Core\ExtensionCode
public function testModuleImplementsAlterNonExistingImplementation() {
// 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()->getImplementations('unimplemented_test_hook');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.