You are here

public function InstallTest::testUninstallPostUpdateFunctions in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Module/InstallTest.php \Drupal\system\Tests\Module\InstallTest::testUninstallPostUpdateFunctions()

Ensures that post update functions are removed on uninstall.

File

core/modules/system/src/Tests/Module/InstallTest.php, line 65
Contains \Drupal\system\Tests\Module\InstallTest.

Class

InstallTest
Tests the installation of modules.

Namespace

Drupal\system\Tests\Module

Code

public function testUninstallPostUpdateFunctions() {
  \Drupal::service('module_installer')
    ->uninstall([
    'module_test',
  ]);
  $post_update_key_value = \Drupal::keyValue('post_update');
  $existing_updates = $post_update_key_value
    ->get('existing_updates', []);
  $this
    ->assertFalse(in_array('module_test_post_update_test', $existing_updates));
}