You are here

public function LingotekModuleUninstallationTest::testUninstallModule in Lingotek Translation 3.8.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()
  2. 4.0.x tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()
  3. 3.0.x tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()
  4. 3.1.x tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()
  5. 3.2.x tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()
  6. 3.3.x tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()
  7. 3.4.x tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()
  8. 3.5.x tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()
  9. 3.6.x tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()
  10. 3.7.x tests/src/Functional/LingotekModuleUninstallationTest.php \Drupal\Tests\lingotek\Functional\LingotekModuleUninstallationTest::testUninstallModule()

Tests that the module can be enabled.

File

tests/src/Functional/LingotekModuleUninstallationTest.php, line 34

Class

LingotekModuleUninstallationTest
Tests that the module can be uninstalled.

Namespace

Drupal\Tests\lingotek\Functional

Code

public function testUninstallModule() {

  // Login as admin.
  $this
    ->drupalLogin($this->rootUser);

  // Navigate to the Extend page.
  $this
    ->drupalGet('/admin/modules');

  // Ensure the module is not enabled yet.
  $this
    ->assertSession()
    ->checkboxChecked('edit-modules-lingotek-enable');
  $this
    ->clickLink('Uninstall');

  // Post the form uninstalling the lingotek module.
  $edit = [
    'uninstall[lingotek]' => '1',
  ];
  $this
    ->drupalPostForm(NULL, $edit, 'Uninstall');

  // We get an advice and we can confirm.
  $this
    ->assertText('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!');
  $this
    ->assertSession()
    ->responseContains('The listed configuration will be deleted.');
  $this
    ->assertSession()
    ->responseContains('Lingotek Profile');
  $this
    ->drupalPostForm(NULL, [], 'Uninstall');
  $this
    ->assertSession()
    ->responseContains('The selected modules have been uninstalled.');
}