ForumTestCase::deleteForum

7 forum.test ForumTestCase::deleteForum($tid)
8 forum.test ForumTestCase::deleteForum($tid)

Delete a forum.

Parameters

$tid: The forum ID.

File

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