function SystemTestHooks::modulesInstalled
Same name and namespace in other branches
- 11.x core/modules/system/tests/modules/system_test/src/Hook/SystemTestHooks.php \Drupal\system_test\Hook\SystemTestHooks::modulesInstalled()
Implements hook_modules_installed().
Attributes
#[Hook('modules_installed')]
File
-
core/
modules/ system/ tests/ modules/ system_test/ src/ Hook/ SystemTestHooks.php, line 37
Class
- SystemTestHooks
- Hook implementations for system_test.
Namespace
Drupal\system_test\HookCode
public function modulesInstalled(array $modules, bool $is_syncing) : void {
if (\Drupal::state()->get('system_test.verbose_module_hooks')) {
foreach ($modules as $module) {
\Drupal::messenger()->addStatus($this->t('hook_modules_installed fired for @module', [
'@module' => $module,
]));
}
}
// Save the config.installer isSyncing() value to state to check that it is
// correctly set when installing module during config import.
\Drupal::state()->set('system_test_modules_installed_module_config_installer_syncing', \Drupal::service('config.installer')->isSyncing());
// Save the $is_syncing parameter value to state to check that it is
// correctly set when installing module during config import.
\Drupal::state()->set('system_test_modules_installed_module_syncing_param', $is_syncing);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.