Enables modules for this test.
Callbacks invoked by module_enable() may need to access information provided by info hooks of the new modules already. However, module_enable() enables the new modules in the system.module configuration only, but that has no effect, since we are operating with a fixed module list.
@todo Remove this method as soon as there is an Extensions service implementation that is able to manage a fixed module list.
array $modules: A list of modules to enable. Dependencies are not resolved; i.e., multiple modules have to be specified with dependent modules first.
bool $install: (optional) Whether to install the list of modules via module_enable(). Defaults to TRUE. If FALSE, the new modules are only added to the fixed module list and loaded.
protected function enableModules(array $modules, $install = TRUE) {
// Set the modules in the fixed module_list().
$new_enabled = array();
foreach ($modules as $module) {
$this->moduleList[$module]['filename'] = drupal_get_filename('module', $module);
$new_enabled[$module] = dirname($this->moduleList[$module]['filename']);
module_list(NULL, $this->moduleList);
// Call module_enable() to enable (install) the new module.
if ($install) {
module_enable(array(
$module,
), FALSE);
}
}
// Otherwise, only ensure that the new modules are loaded.
if (!$install) {
module_load_all(FALSE, TRUE);
module_implements_reset();
}
}