From 88f80206eca409f5d439a27cefd41be1d705efdb Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Sun, 25 Oct 2015 18:21:00 -0700
Subject: [PATCH] Issue #2597860 by neclimdul: UpdateRegistryTest tests missing
 assertions

---
 .../Tests/Core/Update/UpdateRegistryTest.php  | 32 ++++++++++++++-----
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
index de59c38bfc0f..64a7a2f496bc 100644
--- a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
+++ b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
@@ -236,8 +236,12 @@ public function testGetModuleUpdateFunctions() {
   public function testRegisterInvokedUpdatesWithoutExistingUpdates() {
     $this->setupBasicModules();
     $key_value = $this->prophesize(KeyValueStoreInterface::class);
-    $key_value->get('existing_updates', [])->willReturn([]);
-    $key_value->set('existing_updates', ['module_a_post_update_a'])->willReturn(NULL);
+    $key_value->get('existing_updates', [])
+      ->willReturn([])
+      ->shouldBeCalledTimes(1);
+    $key_value->set('existing_updates', ['module_a_post_update_a'])
+      ->willReturn(NULL)
+      ->shouldBeCalledTimes(1);
     $key_value = $key_value->reveal();
 
     $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
@@ -253,8 +257,12 @@ public function testRegisterInvokedUpdatesWithoutExistingUpdates() {
   public function testRegisterInvokedUpdatesWithMultiple() {
     $this->setupBasicModules();
     $key_value = $this->prophesize(KeyValueStoreInterface::class);
-    $key_value->get('existing_updates', [])->willReturn([]);
-    $key_value->set('existing_updates', ['module_a_post_update_a', 'module_a_post_update_b'])->willReturn(NULL);
+    $key_value->get('existing_updates', [])
+      ->willReturn([])
+      ->shouldBeCalledTimes(1);
+    $key_value->set('existing_updates', ['module_a_post_update_a', 'module_a_post_update_b'])
+      ->willReturn(NULL)
+      ->shouldBeCalledTimes(1);
     $key_value = $key_value->reveal();
 
     $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
@@ -270,8 +278,12 @@ public function testRegisterInvokedUpdatesWithMultiple() {
   public function testRegisterInvokedUpdatesWithExistingUpdates() {
     $this->setupBasicModules();
     $key_value = $this->prophesize(KeyValueStoreInterface::class);
-    $key_value->get('existing_updates', [])->willReturn(['module_a_post_update_b']);
-    $key_value->set('existing_updates', ['module_a_post_update_b', 'module_a_post_update_a'])->willReturn(NULL);
+    $key_value->get('existing_updates', [])
+      ->willReturn(['module_a_post_update_b'])
+      ->shouldBeCalledTimes(1);
+    $key_value->set('existing_updates', ['module_a_post_update_b', 'module_a_post_update_a'])
+      ->willReturn(NULL)
+      ->shouldBeCalledTimes(1);
     $key_value = $key_value->reveal();
 
     $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
@@ -287,8 +299,12 @@ public function testRegisterInvokedUpdatesWithExistingUpdates() {
   public function testFilterOutInvokedUpdatesByModule() {
     $this->setupBasicModules();
     $key_value = $this->prophesize(KeyValueStoreInterface::class);
-    $key_value->get('existing_updates', [])->willReturn(['module_a_post_update_b', 'module_a_post_update_a', 'module_b_post_update_a']);
-    $key_value->set('existing_updates', ['module_b_post_update_a'])->willReturn(NULL);
+    $key_value->get('existing_updates', [])
+      ->willReturn(['module_a_post_update_b', 'module_a_post_update_a', 'module_b_post_update_a'])
+      ->shouldBeCalledTimes(1);
+    $key_value->set('existing_updates', ['module_b_post_update_a'])
+      ->willReturn(NULL)
+      ->shouldBeCalledTimes(1);
     $key_value = $key_value->reveal();
 
     $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
-- 
GitLab