Issue #1503224 by catch, sun, chx, bojanz, tim.plunkett: Cleanup module_list().

8.0.x
webchick 2012-07-27 15:29:21 -05:00
parent f82ad8740f
commit 0e4742c536
6 changed files with 8 additions and 7 deletions

View File

@ -380,7 +380,7 @@ function drupal_install_system() {
// Clear out module list and hook implementation statics before calling
// system_rebuild_theme_data().
drupal_static_reset('system_list');
system_list_reset();
module_list_reset();
module_implements_reset();

View File

@ -73,7 +73,7 @@ function drupal_get_complete_schema($rebuild = FALSE) {
// we force the system_list() static cache to be refreshed to ensure
// that it contains the complete list of modules before we go on to call
// module_load_all_includes().
drupal_static_reset('system_list');
system_list_reset();
module_load_all_includes('install');
}

View File

@ -789,7 +789,7 @@ abstract class WebTestBase extends TestBase {
// Reload module list and implementations to ensure that test module hooks
// aren't called after tests.
drupal_static_reset('system_list');
system_list_reset();
module_list_reset();
module_implements_reset();

View File

@ -132,7 +132,7 @@ class ModuleTestBase extends WebTestBase {
* Expected module state.
*/
function assertModules(array $modules, $enabled) {
drupal_static_reset('system_list');
system_list_reset();
foreach ($modules as $module) {
if ($enabled) {
$message = 'Module "@module" is enabled.';

View File

@ -48,7 +48,7 @@ class MainContentFallbackTest extends WebTestBase {
$edit['modules[Core][block][enable]'] = FALSE;
$this->drupalPost('admin/modules', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
drupal_static_reset('system_list');
system_list_reset();
$this->assertFalse(module_exists('block'), t('Block module disabled.'));
// At this point, no region is filled and fallback should be triggered.
@ -82,7 +82,7 @@ class MainContentFallbackTest extends WebTestBase {
$edit['modules[Core][block][enable]'] = 'block';
$this->drupalPost('admin/modules', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
drupal_static_reset('system_list');
system_list_reset();
$this->assertTrue(module_exists('block'), t('Block module re-enabled.'));
}
}

View File

@ -253,7 +253,8 @@ abstract class UpgradePathTestBase extends WebTestBase {
// Reload module list. For modules that are enabled in the test database,
// but not on the test client, we need to load the code here.
$new_modules = array_diff(module_list(TRUE), $this->loadedModules);
system_list_reset();
$new_modules = array_diff(module_list(), $this->loadedModules);
foreach ($new_modules as $module) {
drupal_load('module', $module);
}