function ForumUninstallTest::testForumUninstallWithoutForumVocabulary

Same name in other branches
  1. 10 core/modules/forum/tests/src/Functional/ForumUninstallTest.php \Drupal\Tests\forum\Functional\ForumUninstallTest::testForumUninstallWithoutForumVocabulary()
  2. 11.x core/modules/forum/tests/src/Functional/ForumUninstallTest.php \Drupal\Tests\forum\Functional\ForumUninstallTest::testForumUninstallWithoutForumVocabulary()

Tests uninstallation of forum module when vocabulary is deleted.

File

core/modules/forum/tests/src/Functional/ForumUninstallTest.php, line 166

Class

ForumUninstallTest
Tests forum module uninstallation.

Namespace

Drupal\Tests\forum\Functional

Code

public function testForumUninstallWithoutForumVocabulary() {
    $this->drupalLogin($this->rootUser);
    Vocabulary::load('forums')->delete();
    // Now attempt to uninstall forum.
    $this->drupalGet('admin/modules/uninstall');
    $this->assertSession()
        ->responseNotContains('The website encountered an unexpected error. Please try again later');
    $this->assertSession()
        ->statusCodeEquals(200);
    // Assert forum is no longer required.
    $this->assertSession()
        ->fieldExists('uninstall[forum]');
    $this->drupalGet('admin/modules/uninstall');
    $this->submitForm([
        'uninstall[forum]' => 1,
    ], 'Uninstall');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.