diff options
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/drupal_web_test_case.php | 8 | ||||
-rw-r--r-- | modules/simpletest/tests/module.test | 22 |
2 files changed, 15 insertions, 15 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php index c5d2926e9..9ba935559 100644 --- a/modules/simpletest/drupal_web_test_case.php +++ b/modules/simpletest/drupal_web_test_case.php @@ -1136,18 +1136,18 @@ class DrupalWebTestCase extends DrupalTestCase { $this->preloadRegistry(); - // Include the default profile + // Include the default profile. variable_set('install_profile', 'standard'); $profile_details = install_profile_info('standard', 'en'); // Install the modules specified by the default profile. - drupal_install_modules($profile_details['dependencies'], TRUE); + module_enable($profile_details['dependencies'], FALSE, TRUE); drupal_static_reset('_node_types_build'); if ($modules = func_get_args()) { // Install modules needed for this test. - drupal_install_modules($modules, TRUE); + module_enable($modules, TRUE, TRUE); } // Because the schema is static cached, we need to flush @@ -1158,7 +1158,7 @@ class DrupalWebTestCase extends DrupalTestCase { // Run default profile tasks. $install_state = array(); - drupal_install_modules(array('standard'), TRUE); + module_enable(array('standard'), FALSE, TRUE); // Rebuild caches. node_types_rebuild(); diff --git a/modules/simpletest/tests/module.test b/modules/simpletest/tests/module.test index 939804953..242910c7f 100644 --- a/modules/simpletest/tests/module.test +++ b/modules/simpletest/tests/module.test @@ -37,7 +37,7 @@ class ModuleUnitTest extends DrupalWebTestCase { $this->assertModuleList($module_list, t('Standard profile')); // Try to install a new module. - drupal_install_modules(array('contact')); + module_enable(array('contact')); $module_list[] = 'contact'; sort($module_list); $this->assertModuleList($module_list, t('After adding a module')); @@ -101,25 +101,25 @@ class ModuleUnitTest extends DrupalWebTestCase { } /** - * Test drupal_install_modules() and dependency resolution. + * Test dependency resolution. */ - function testDrupalInstallModules() { - drupal_install_modules(array('module_test')); + function testDependencyResolution() { + module_enable(array('module_test'), FALSE); $this->assertTrue(module_exists('module_test'), t('Test module is enabled.')); // First, create a fake missing dependency. Forum depends on poll, which // depends on a made-up module, foo. Nothing should be installed. variable_set('dependency_test', 'missing dependency'); - $result = drupal_install_modules(array('forum')); - $this->assertFalse($result, t('drupal_install_modules() returns FALSE if dependencies are missing.')); - $this->assertFalse(module_exists('forum'), t('drupal_install_modules() aborts if dependencies are missing.')); + $result = module_enable(array('forum')); + $this->assertFalse($result, t('module_enable() returns FALSE if dependencies are missing.')); + $this->assertFalse(module_exists('forum'), t('module_enable() aborts if dependencies are missing.')); - // Now, fix the missing dependency. drupal_install_modules() should work. + // Now, fix the missing dependency. module_enable() should work. variable_set('dependency_test', 'dependency'); - $result = drupal_install_modules(array('forum')); - $this->assertTrue($result, t('drupal_install_modules() returns the correct value.')); + $result = module_enable(array('forum')); + $this->assertTrue($result, t('module_enable() returns the correct value.')); // Verify that the fake dependency chain was installed. - $this->assertTrue(module_exists('poll') && module_exists('php'), t('Dependency chain was installed by drupal_install_modules().')); + $this->assertTrue(module_exists('poll') && module_exists('php'), t('Dependency chain was installed by module_enable().')); // Finally, verify that the original module was installed. $this->assertTrue(module_exists('forum'), t('Module installation with unlisted dependencies succeeded.')); } |