public function ParagraphsUninstallTest::testUninstall

Tests that Paragraphs module can be uninstalled.

File

paragraphs/tests/src/Functional/ParagraphsUninstallTest.php, line 42

Class

ParagraphsUninstallTest
Tests that Paragraphs module can be uninstalled.

Namespace

Drupal\Tests\paragraphs\Functional

Code

public function testUninstall() {

  // Uninstall the module paragraphs_demo.
  $this
    ->drupalGet('admin/modules/uninstall');
  $this
    ->submitForm([
    'uninstall[paragraphs_demo]' => TRUE,
  ], 'Uninstall');
  $this
    ->submitForm([], 'Uninstall');

  // Delete library data.
  $this
    ->clickLink('Remove Paragraphs library items');
  $this
    ->submitForm([], 'Delete all Paragraphs library items');

  // Uninstall the library module.
  $this
    ->drupalGet('admin/modules/uninstall');
  $this
    ->submitForm([
    'uninstall[paragraphs_library]' => TRUE,
  ], 'Uninstall');
  $this
    ->submitForm([], 'Uninstall');

  // Delete paragraphs data.
  $this
    ->clickLink('Remove Paragraphs');
  $this
    ->submitForm([], 'Delete all Paragraphs');

  // Uninstall the module paragraphs.
  $this
    ->drupalGet('admin/modules/uninstall');
  $this
    ->submitForm([
    'uninstall[paragraphs]' => TRUE,
  ], 'Uninstall');
  $this
    ->submitForm([], 'Uninstall');
  $this
    ->assertSession()
    ->pageTextContains('The selected modules have been uninstalled.');
  $this
    ->assertSession()
    ->pageTextNotContains('Paragraphs demo');
  $this
    ->assertSession()
    ->pageTextNotContains('Paragraphs library');
  $this
    ->assertSession()
    ->pageTextNotContains('Paragraphs');
}