You are here

public function InstallTest::testUninstallPostUpdateFunctions in Drupal 10

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

Ensures that post update functions are removed on uninstall.

File

core/modules/system/tests/src/Functional/Module/InstallTest.php, line 69

Class

InstallTest
Tests the installation of modules.

Namespace

Drupal\Tests\system\Functional\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
    ->assertNotContains('module_test_post_update_test', $existing_updates);
}