? .DS_Store
? content-type-js-302054-20.patch
? content-type-js.patch
? install-228761-7.patch
? node-content_type_overview-302120-16.patch
? node-content_type_overview-X-0.patch
? system-module_page_test-314285-1.patch
? system-module_page_test-314285-2.patch
? system-module_page_test-314285-3.patch
? test.html
? misc/.DS_Store
? modules/.DS_Store
? modules/node/.DS_Store
? sites/default/files
? sites/default/settings.php
Index: modules/system/system.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.test,v
retrieving revision 1.12
diff -u -p -r1.12 system.test
--- modules/system/system.test	15 Sep 2008 20:48:09 -0000	1.12
+++ modules/system/system.test	28 Sep 2008 03:08:38 -0000
@@ -26,82 +26,53 @@ class EnableDisableCoreTestCase extends 
   }
 
   /**
-   * Enable a module, check the database for related tables, disable module,
-   * check for related tables, unistall module, check for related tables.
+   * Enable a module, with and without dependencies.
    */
   function testEnableDisable() {
-    // Enable aggregator, and check tables.
-    $this->assertModules(array('aggregator'), FALSE);
-    $this->assertTableCount('aggregator', FALSE);
+    module_disable(array('aggregator', 'forum', 'comment', 'taxonomy'));
+    $this->assertModules(array('aggregator', 'forum', 'comment', 'taxonomy'), FALSE);
 
-    $edit = array();
+    // Make sure enabling a module without a dependency works.
     $edit['modules[Core - optional][aggregator][enable]'] = 'aggregator';
     $this->drupalPost('admin/build/modules', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
-
     $this->assertModules(array('aggregator'), TRUE);
-    $this->assertTableCount('aggregator', TRUE);
 
-    // Disable aggregator, check tables, uninstall aggregator, check tables.
+    // Enable the forum module, and get the confirm form.
     $edit = array();
-    $edit['modules[Core - optional][aggregator][enable]'] = FALSE;
+    $edit['modules[Core - optional][forum][enable]'] = 'forum';
     $this->drupalPost('admin/build/modules', $edit, t('Save configuration'));
+    $this->assertText(t('You must enable the @dependencies modules to install @module.', array('@dependencies' => 'Taxonomy, Comment', '@module' => 'Forum')), t("Confirmation page shows up."));
+    $this->drupalPost(NULL, array(), t('Continue'));
     $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
+    $this->assertModules(array('forum', 'comment', 'taxonomy'), TRUE);
 
-    $this->assertModules(array('aggregator'), FALSE);
-    $this->assertTableCount('aggregator', TRUE);
+    // Make sure we can't disable comment and taxonomy modules.
+    $this->drupalGet('admin/build/modules');
+    $this->assertXPath('//input[name="modules[Core - optional][comment][enable]"][disabled]', t('Disabling the comment module isn\'t allowed'));
+    $this->assertXPath('//input[name="modules[Core - optional][taxonomy][enable]"][disabled]', t('Disabling the taxonomy module isn\'t allowed'));
 
+    // Disable forum module.
     $edit = array();
-    $edit['uninstall[aggregator]'] = 'aggregator';
-    $this->drupalPost('admin/build/modules/uninstall', $edit, t('Uninstall'));
-
-    $this->drupalPost(NULL, NULL, t('Uninstall'));
-    $this->assertText(t('The selected modules have been uninstalled.'), t('Modules status has been updated.'));
-
-    $this->assertModules(array('aggregator'), FALSE);
-    $this->assertTableCount('aggregator', FALSE);
-  }
-
-  /**
-   * Attempt to enable translation module without locale enabled.
-   */
-  function testEnableWithoutDependency () {
-    // Attempt to enable content translation without locale enabled.
-    $edit = array();
-    $edit['modules[Core - optional][translation][enable]'] = 'translation';
+    $edit['modules[Core - optional][forum][enable]'] = FALSE;
     $this->drupalPost('admin/build/modules', $edit, t('Save configuration'));
-    $this->assertText(t('Some required modules must be enabled'), t('Dependecy required.'));
-
-    $this->assertModules(array('translation', 'locale'), FALSE);
-
-    // Assert that the locale tables weren't enabled.
-    $this->assertTableCount('languages', FALSE);
-    $this->assertTableCount('locale', FALSE);
-
-    $this->drupalPost(NULL, NULL, t('Continue'));
     $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
+    $this->assertModules(array('forum'), FALSE);
+    $this->assertModules(array('comment', 'taxonomy'), TRUE);
 
-    $this->assertModules(array('translation', 'locale'), TRUE);
-
-    // Assert that the locale tables were enabled.
-    $this->assertTableCount('languages', TRUE);
-    $this->assertTableCount('locale', TRUE);
-  }
-
-  /**
-   * Assert tables that begin with the specified base table name.
-   *
-   * @param string $base_table Begginning of table name to look for.
-   * @param boolean $count Assert tables that match specified base table.
-   * @return boolean Tables with specified base table.
-   */
-  function assertTableCount($base_table, $count) {
-    $match_count = simpletest_get_like_tables($base_table, TRUE);
+    // Disable others.
+    $edit['modules[Core - optional][comment][enable]'] = FALSE;
+    $edit['modules[Core - optional][taxonomy][enable]'] = FALSE;
+    $this->drupalPost('admin/build/modules', $edit, t('Save configuration'));
+    $this->assertModules(array('comment', 'taxonomy'), FALSE);
 
-    if ($count) {
-      return $this->assertTrue($match_count, t('Tables matching "@base_table" found.', array('@base_table' => $base_table)));
-    }
-    return $this->assertFalse($match_count, t('Tables matching "@base_table" not found.', array('@base_table' => $base_table)));
+    // Enable all three and don't get a confirm form.
+    $edit['modules[Core - optional][comment][enable]'] = 'comment';
+    $edit['modules[Core - optional][taxonomy][enable]'] = 'taxonomy';
+    $edit['modules[Core - optional][forum][enable]'] = 'forum';
+    $this->drupalPost('admin/build/modules', $edit, t('Save configuration'));
+    $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
+    $this->assertModules(array('forum', 'comment', 'taxonomy'), TRUE);
   }
 
   /**
