You are here

public function NodeorderUninstallTest::testUninstall in Node Order 8

Tests module uninstallation.

File

tests/src/Kernel/NodeorderUninstallTest.php, line 15

Class

NodeorderUninstallTest
Tests the uninstallation of module.

Namespace

Drupal\Tests\nodeorder\Kernel

Code

public function testUninstall() {
  $schema = $this->database
    ->schema();

  // Need to ensure that filed and index exists before uninstallation.
  // Otherwise test will be successfully passed every time.
  // @see: \Drupal\Tests\nodeorder\Kernel\NodeorderInstallTest::testInstall().
  $this
    ->assertTrue($schema
    ->fieldExists('taxonomy_index', 'weight'));
  $this
    ->assertTrue($schema
    ->indexExists('taxonomy_index', 'weight'));
  $this->moduleInstaller
    ->uninstall([
    'nodeorder',
  ]);
  $this
    ->assertFalse($schema
    ->fieldExists('taxonomy_index', 'weight'));
  $this
    ->assertFalse($schema
    ->indexExists('taxonomy_index', 'weight'));
}