function ForumTestCase::deleteForum
Deletes a forum.
Parameters
$tid: The forum ID.
1 call to ForumTestCase::deleteForum()
- ForumTestCase::doAdminTests in modules/
forum/ forum.test - Runs admin tests on the admin user.
File
-
modules/
forum/ forum.test, line 447
Class
- ForumTestCase
- Provides automated tests for the Forum module.
Code
function deleteForum($tid) {
// Delete the forum.
$this->drupalPost('admin/structure/forum/edit/forum/' . $tid, array(), t('Delete'));
$this->drupalPost(NULL, array(), t('Delete'));
// Assert that the forum no longer exists.
$this->drupalGet('forum/' . $tid);
$this->assertResponse(404, 'The forum was not found');
// Assert that the associated term has been removed from the
// forum_containers variable.
$containers = variable_get('forum_containers', array());
$this->assertFalse(in_array($tid, $containers), 'The forum_containers variable has been updated.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.