You are here

protected function InstallUninstallTest::assertUninstallModuleUpdates in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Module/InstallUninstallTest.php \Drupal\system\Tests\Module\InstallUninstallTest::assertUninstallModuleUpdates()

Asserts the module post update functions after uninstall.

Parameters

string $module: The module that got installed.

1 call to InstallUninstallTest::assertUninstallModuleUpdates()
InstallUninstallTest::assertSuccessfulUninstall in core/modules/system/src/Tests/Module/InstallUninstallTest.php
Uninstalls a module and asserts that it was done correctly.

File

core/modules/system/src/Tests/Module/InstallUninstallTest.php, line 279
Contains \Drupal\system\Tests\Module\InstallUninstallTest.

Class

InstallUninstallTest
Install/uninstall core module and confirm table creation/deletion.

Namespace

Drupal\system\Tests\Module

Code

protected function assertUninstallModuleUpdates($module) {

  /** @var \Drupal\Core\Update\UpdateRegistry $post_update_registry */
  $post_update_registry = \Drupal::service('update.post_update_registry');
  $all_update_functions = $post_update_registry
    ->getPendingUpdateFunctions();
  switch ($module) {
    case 'block':
      $this
        ->assertFalse(array_intersect([
        'block_post_update_disable_blocks_with_missing_contexts',
      ], $all_update_functions), 'Asserts that no pending post update functions are available.');
      $existing_updates = \Drupal::keyValue('post_update')
        ->get('existing_updates', []);
      $this
        ->assertFalse(array_intersect([
        'block_post_update_disable_blocks_with_missing_contexts',
      ], $existing_updates), 'Asserts that no post update functions are stored in keyvalue store.');
      break;
  }
}