function ForumTestCase::deleteForum
7.x forum.test | ForumTestCase::deleteForum($tid) |
Deletes a forum.
Parameters
$tid: The forum ID.
1 call to ForumTestCase::deleteForum()
- ForumTestCase::doAdminTests in drupal-7.x/
modules/ forum/ forum.test - Runs admin tests on the admin user.
File
- drupal-7.x/
modules/ forum/ forum.test, line 402 - Tests for forum.module.
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.');
}