You are here

public function ForumTest::deleteForum in Drupal 8

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

Deletes a forum.

Parameters

int $tid: The forum ID.

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

File

core/modules/forum/tests/src/Functional/ForumTest.php, line 487

Class

ForumTest
Tests for forum.module.

Namespace

Drupal\Tests\forum\Functional

Code

public 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, [], t('Delete'));

  // Assert that the forum no longer exists.
  $this
    ->drupalGet('forum/' . $tid);
  $this
    ->assertSession()
    ->statusCodeEquals(404);
}