function ModuleHandlerTest::testInvokeModuleEnabled
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testInvokeModuleEnabled()
- 10 core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testInvokeModuleEnabled()
- 11.x core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php \Drupal\Tests\Core\Extension\ModuleHandlerTest::testInvokeModuleEnabled()
Test invoke methods when module is enabled.
@covers ::invoke
File
-
core/
tests/ Drupal/ Tests/ Core/ Extension/ ModuleHandlerTest.php, line 301
Class
- ModuleHandlerTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Extension%21ModuleHandler.php/class/ModuleHandler/8.9.x" title="Class that manages modules in a Drupal installation." class="local">\Drupal\Core\Extension\ModuleHandler</a> @runTestsInSeparateProcesses
Namespace
Drupal\Tests\Core\ExtensionCode
public function testInvokeModuleEnabled() {
$module_handler = $this->getModuleHandler();
$this->assertTrue($module_handler->invoke('module_handler_test', 'hook', [
TRUE,
]), 'Installed module runs hook.');
$this->assertFalse($module_handler->invoke('module_handler_test', 'hook', [
FALSE,
]), 'Installed module runs hook.');
$this->assertNull($module_handler->invoke('module_handler_test_fake', 'hook', [
FALSE,
]), 'Installed module runs hook.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.