You are here

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

Test uninstall the module without mishap.

File

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

Class

InstallUninstallTest
Test uninstall functionality of Site Version module.

Namespace

Drupal\Tests\entity_update\Functional

Code

public function testInstallUninstallInt() {

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

  /* @var $installer \Drupal\Core\Extension\ModuleInstallerInterface */
  $installer = $this->container
    ->get('module_installer');
  $this
    ->assertTrue($installer
    ->uninstall([
    'entity_update',
  ]));

  // Install test module.
  \Drupal::service('module_installer')
    ->install([
    'entity_update_tests',
  ]);
  $this
    ->assertTrue($installer
    ->uninstall([
    'entity_update',
  ]));

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