function ModuleInstallerTest::testInvokingRespondentHooks
Ensure that hooks reacting to install or uninstall are invoked.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Extension/ ModuleInstallerTest.php, line 97
Class
- ModuleInstallerTest
- Tests the ModuleInstaller class.
Namespace
Drupal\KernelTests\Core\ExtensionCode
public function testInvokingRespondentHooks() : void {
$module_installer = $this->container
->get('module_installer');
$this->assertTrue($module_installer->install([
'respond_install_uninstall_hook_test',
]));
$this->assertTrue($module_installer->install([
'cache_test',
]));
$this->assertTrue(isset($GLOBALS['hook_module_preinstall']));
$this->assertTrue(isset($GLOBALS['hook_modules_installed']));
$module_installer->uninstall([
'cache_test',
]);
$this->assertTrue(isset($GLOBALS['hook_module_preuninstall']));
$this->assertTrue(isset($GLOBALS['hook_modules_uninstalled']));
$this->assertTrue(isset($GLOBALS['hook_cache_flush']));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.