You are here

public function InstallUninstallTest::testInstallUninstallWeb in Entity Update 2.0.x

Test that we can uninstall by interface.

File

tests/src/Functional/InstallUninstallTest.php, line 68

Class

InstallUninstallTest
Test uninstall functionality of Site Version module.

Namespace

Drupal\Tests\entity_update\Functional

Code

public function testInstallUninstallWeb() {
  $assert = $this
    ->assertSession();

  // Test if site opens with no errors.
  $this
    ->drupalGet('');
  $assert
    ->statusCodeEquals(200);

  // Uninstall the module field_gallery.
  $edit = [];
  $edit['uninstall[entity_update]'] = TRUE;
  $this
    ->drupalPostForm('admin/modules/uninstall', $edit, 'Uninstall');
  $assert
    ->pageTextContains('Entity Update');
  $this
    ->drupalPostForm(NULL, NULL, 'Uninstall');
  $assert
    ->pageTextContains('The selected modules have been uninstalled.');

  // Re test if site opens with no errors.
  $this
    ->drupalGet('');
  $assert
    ->statusCodeEquals(200);
}