diff options
Diffstat (limited to 'modules/forum/forum.test')
-rw-r--r-- | modules/forum/forum.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/forum/forum.test b/modules/forum/forum.test index 1dc45c6fd..c7c3d9c1b 100644 --- a/modules/forum/forum.test +++ b/modules/forum/forum.test @@ -31,6 +31,7 @@ class ForumTestCase extends DrupalWebTestCase { // Create users. $this->admin_user = $this->drupalCreateUser(array( 'access administration pages', + 'administer modules', 'administer blocks', 'administer forums', 'administer menu', @@ -52,6 +53,30 @@ class ForumTestCase extends DrupalWebTestCase { } /** + * Tests disabling and re-enabling forum. + */ + function testEnableForumField() { + $this->drupalLogin($this->admin_user); + + // Disable the forum module. + $edit = array(); + $edit['modules[Core][forum][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.')); + module_list(TRUE); + $this->assertFalse(module_exists('forum'), t('Forum module is not enabled.')); + + // Attempt to re-enable the forum module and ensure it does not try to + // recreate the taxonomy_forums field. + $edit = array(); + $edit['modules[Core][forum][enable]'] = 'forum'; + $this->drupalPost('admin/modules', $edit, t('Save configuration')); + $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); + module_list(TRUE); + $this->assertTrue(module_exists('forum'), t('Forum module is enabled.')); + } + + /** * Login users, create forum nodes, and test forum functionality through the admin and user interfaces. */ function testForum() { |