diff --git a/core/modules/system/src/Tests/Module/InstallUninstallTest.php b/core/modules/system/src/Tests/Module/InstallUninstallTest.php index 261b306..3573247 100644 --- a/core/modules/system/src/Tests/Module/InstallUninstallTest.php +++ b/core/modules/system/src/Tests/Module/InstallUninstallTest.php @@ -210,10 +210,10 @@ protected function assertModuleUpdates($module) { $existing_updates = \Drupal::keyValue('post_update')->get('existing_updates', []); switch ($module) { case 'block': - $this->assertEqual(['block_post_update_disable_blocks_with_missing_contexts'], $existing_updates[$module]); + $this->assertFalse(array_diff(['block_post_update_disable_blocks_with_missing_contexts'], $existing_updates)); break; case 'update_test_postupdate': - $this->assertEqual(['update_test_postupdate_post_update_first', 'update_test_postupdate_post_update_second', 'update_test_postupdate_post_update_test1', 'update_test_postupdate_post_update_test0'], $existing_updates[$module]); + $this->assertFalse(array_diff(['update_test_postupdate_post_update_first', 'update_test_postupdate_post_update_second', 'update_test_postupdate_post_update_test1', 'update_test_postupdate_post_update_test0'], $existing_updates)); break; } } @@ -228,10 +228,15 @@ 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(); - $this->assertTrue(empty($all_update_functions[$module]), 'Ensures that no pending post update functions are available.'); - $existing_updates = \Drupal::keyValue('post_update')->get('existing_updates', []); - $this->assertTrue(empty($existing_updates[$module]), 'Ensures that no pending post update functions are available.'); + switch ($module) { + case 'block': + $this->assertFalse(array_intersect(['block_post_update_disable_blocks_with_missing_contexts'], $all_update_functions), 'Ensures 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), 'Ensures that no pending post update functions are available.'); + break; + } } }