ForumTestCase::testEnableForumField

7 forum.test ForumTestCase::testEnableForumField()
8 forum.test ForumTestCase::testEnableForumField()

Tests disabling and re-enabling forum.

File

modules/forum/forum.test, line 58
Tests for 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.'), 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 or register to post comments