function ModuleHandlerTest::testInvokeWithNotMergeableString
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php \Drupal\Tests\system\Kernel\Extension\ModuleHandlerTest::testInvokeWithNotMergeableString()
Tests invoke fails for multiple implementations that cannot be merged.
File
-
core/
modules/ system/ tests/ src/ Kernel/ Extension/ ModuleHandlerTest.php, line 422
Class
- ModuleHandlerTest
- Tests ModuleHandler functionality.
Namespace
Drupal\Tests\system\Kernel\ExtensionCode
public function testInvokeWithNotMergeableString() : void {
$this->moduleInstaller()
->install([
'hook_single_invoke',
]);
$expected_exception_message = 'Module hook_single_invoke should not implement custom_hook_invoke_string more than once.';
$this->expectException(\LogicException::class);
$this->expectExceptionMessage($expected_exception_message);
$this->moduleHandler()
->invoke('hook_single_invoke', 'custom_hook_invoke_string', args: [
TRUE,
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.