function ForumTestCase::testEnableForumField
Tests disabling and re-enabling the Forum module.
File
-
modules/
forum/ forum.test, line 95
Class
- ForumTestCase
- Provides automated tests for the Forum module.
Code
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.'), 'Modules status has been updated.');
module_list(TRUE);
$this->assertFalse(module_exists('forum'), '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.'), 'Modules status has been updated.');
module_list(TRUE);
$this->assertTrue(module_exists('forum'), 'Forum module is enabled.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.