From 74fac8eb321bff899c9ab4ea92677100a124dfd8 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Mon, 29 Jan 2024 14:21:24 +0000
Subject: [PATCH] Issue #3417560 by longwave: Remove withConsecutive() in
 SqlContentEntityStorageSchemaTest

---
 core/phpstan-baseline.neon                             |  5 -----
 .../Entity/Sql/SqlContentEntityStorageSchemaTest.php   | 10 +++++-----
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon
index dd4da94b3789..d3f60bb4947d 100644
--- a/core/phpstan-baseline.neon
+++ b/core/phpstan-baseline.neon
@@ -3345,11 +3345,6 @@ parameters:
 			count: 1
 			path: tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
 
-		-
-			message: "#^Call to deprecated method withConsecutive\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\Builder\\\\InvocationMocker\\.$#"
-			count: 1
-			path: tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
-
 		-
 			message: """
 				#^Call to deprecated method expectError\\(\\) of class PHPUnit\\\\Framework\\\\TestCase\\:
diff --git a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
index 52882bf1599d..3cc96f3ce8b0 100644
--- a/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php
@@ -1536,12 +1536,12 @@ public function testonEntityTypeUpdateWithNewIndex() {
       ]);
 
     // The original indexes should be dropped before the new one is added.
-    $this->dbSchemaHandler->expects($this->exactly(3))
+    $indexes = ['entity_test__b588603cb9', 'entity_test__removed_field', 'entity_test__b588603cb9'];
+    $this->dbSchemaHandler->expects($this->exactly(count($indexes)))
       ->method('dropIndex')
-      ->withConsecutive(
-        ['entity_test', 'entity_test__b588603cb9'],
-        ['entity_test', 'entity_test__removed_field'],
-      );
+      ->with('entity_test', $this->callback(function ($index) use (&$indexes) {
+        return array_shift($indexes) === $index;
+      }));
 
     $this->dbSchemaHandler->expects($this->atLeastOnce())
       ->method('fieldExists')
-- 
GitLab