diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/EnableDisableTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/EnableDisableTest.php index f326186..e1c26d3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/EnableDisableTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/EnableDisableTest.php @@ -88,7 +88,8 @@ function testEnableDisable() { // Install and enable the module. $edit = array(); - $edit['modules[Core][' . $name . '][enable]'] = $name; + $package = $module->info['package']; + $edit['modules[' . $package . '][' . $name . '][enable]'] = $name; $this->drupalPost('admin/modules', $edit, t('Save configuration')); // Handle the case where modules were installed along with this one and // where we therefore hit a confirmation screen. @@ -117,7 +118,7 @@ function testEnableDisable() { // for the dblog module, because that is needed for the test; we'll go // back and do that one at the end also. if ($name != 'dblog') { - $this->assertSuccessfulDisableAndUninstall($name); + $this->assertSuccessfulDisableAndUninstall($name, $package); } } } @@ -127,13 +128,15 @@ function testEnableDisable() { while (!empty($automatically_enabled)) { $initial_count = count($automatically_enabled); foreach (array_keys($automatically_enabled) as $name) { + $module = $modules[$name]; + $package = $module->info['package']; // If the module can't be disabled due to dependencies, skip it and try // again the next time. Otherwise, try to disable it. $this->drupalGet('admin/modules'); - $disabled_checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[Core][' . $name . '][enable]"]'); + $disabled_checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[' . $package . '][' . $name . '][enable]"]'); if (empty($disabled_checkbox) && $name != 'dblog') { unset($automatically_enabled[$name]); - $this->assertSuccessfulDisableAndUninstall($name); + $this->assertSuccessfulDisableAndUninstall($name, $package); } } $final_count = count($automatically_enabled); @@ -158,8 +161,8 @@ function testEnableDisable() { // - That enabling more than one module at the same time does not lead to // any errors. $edit = array(); - foreach (array_keys($modules) as $name) { - $edit['modules[Core][' . $name . '][enable]'] = $name; + foreach ($modules as $name => $module) { + $edit['modules[' . $module->info['package'] . '][' . $name . '][enable]'] = $name; } $this->drupalPost('admin/modules', $edit, t('Save configuration')); $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); @@ -170,11 +173,13 @@ function testEnableDisable() { * * @param string $module * The name of the module to disable and uninstall. + * @param string $package + * The package of the module to disable and uninstall. */ - function assertSuccessfulDisableAndUninstall($module) { + function assertSuccessfulDisableAndUninstall($module, $package = 'Core') { // Disable the module. $edit = array(); - $edit['modules[Core][' . $module . '][enable]'] = FALSE; + $edit['modules[' . $package . '][' . $module . '][enable]'] = FALSE; $this->drupalPost('admin/modules', $edit, t('Save configuration')); $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); $this->assertModules(array($module), FALSE);