You are here

function ForumTest::deleteForum in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/forum/src/Tests/ForumTest.php \Drupal\forum\Tests\ForumTest::deleteForum()

Deletes a forum.

Parameters

int $tid: The forum ID.

1 call to ForumTest::deleteForum()
ForumTest::doAdminTests in core/modules/forum/src/Tests/ForumTest.php
Runs admin tests on the admin user.

File

core/modules/forum/src/Tests/ForumTest.php, line 452
Contains \Drupal\forum\Tests\ForumTest.

Class

ForumTest
Create, view, edit, delete, and change forum entries and verify its consistency in the database.

Namespace

Drupal\forum\Tests

Code

function deleteForum($tid) {

  // Delete the forum.
  $this
    ->drupalGet('admin/structure/forum/edit/forum/' . $tid);
  $this
    ->clickLink(t('Delete'));
  $this
    ->assertText('Are you sure you want to delete the forum');
  $this
    ->assertNoText('Add forum');
  $this
    ->assertNoText('Add forum container');
  $this
    ->drupalPostForm(NULL, array(), t('Delete'));

  // Assert that the forum no longer exists.
  $this
    ->drupalGet('forum/' . $tid);
  $this
    ->assertResponse(404, 'The forum was not found');
}