From 57a060ea431c9722a8a03ffe6caa59df402b33ed Mon Sep 17 00:00:00 2001
From: nod_ <nod_@598310.no-reply.drupal.org>
Date: Thu, 22 Aug 2024 21:47:08 +0200
Subject: [PATCH] Issue #3469580 by catch, smustgrave: Speed up
 UpdateSemverTestSecurityAvailabilityTrait

(cherry picked from commit 0066ab0fce5ca8753a25407263975470d1a8e295)
---
 .../UpdateSemverContribSecurityAvailabilityTest.php |  1 -
 .../UpdateSemverCoreSecurityAvailabilityTest.php    |  1 -
 .../UpdateSemverTestSecurityAvailabilityTrait.php   | 13 ++++++++++---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/core/modules/update/tests/src/Functional/UpdateSemverContribSecurityAvailabilityTest.php b/core/modules/update/tests/src/Functional/UpdateSemverContribSecurityAvailabilityTest.php
index 205a117755f6..6dd653caeae9 100644
--- a/core/modules/update/tests/src/Functional/UpdateSemverContribSecurityAvailabilityTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateSemverContribSecurityAvailabilityTest.php
@@ -8,7 +8,6 @@
  * Tests Update Manager with a security update available for a contrib project.
  *
  * @group update
- * @group #slow
  */
 class UpdateSemverContribSecurityAvailabilityTest extends UpdateSemverContribTestBase {
 
diff --git a/core/modules/update/tests/src/Functional/UpdateSemverCoreSecurityAvailabilityTest.php b/core/modules/update/tests/src/Functional/UpdateSemverCoreSecurityAvailabilityTest.php
index 2ebf763f48f7..4b64e54a943b 100644
--- a/core/modules/update/tests/src/Functional/UpdateSemverCoreSecurityAvailabilityTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateSemverCoreSecurityAvailabilityTest.php
@@ -8,7 +8,6 @@
  * Tests Update Manager with a security update available for Drupal core.
  *
  * @group update
- * @group #slow
  */
 class UpdateSemverCoreSecurityAvailabilityTest extends UpdateSemverCoreTestBase {
 
diff --git a/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php b/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php
index 7c2d3faac53b..3a5ca8859859 100644
--- a/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php
+++ b/core/modules/update/tests/src/Functional/UpdateSemverTestSecurityAvailabilityTrait.php
@@ -9,6 +9,15 @@
  */
 trait UpdateSemverTestSecurityAvailabilityTrait {
 
+  /**
+   * Tests the update manager when a security update is available.
+   */
+  public function testSecurityUpdateAvailability(): void {
+    foreach (static::securityUpdateAvailabilityProvider() as $case) {
+      $this->doTestSecurityUpdateAvailability($case['site_patch_version'], $case['expected_security_releases'], $case['expected_update_message_type'], $case['fixture']);
+    }
+  }
+
   /**
    * Tests the Update Manager module when a security update is available.
    *
@@ -20,10 +29,8 @@ trait UpdateSemverTestSecurityAvailabilityTrait {
    *   The type of update message expected.
    * @param string $fixture
    *   The test fixture that contains the test XML.
-   *
-   * @dataProvider securityUpdateAvailabilityProvider
    */
-  public function testSecurityUpdateAvailability($site_patch_version, array $expected_security_releases, $expected_update_message_type, $fixture): void {
+  protected function doTestSecurityUpdateAvailability($site_patch_version, array $expected_security_releases, $expected_update_message_type, $fixture): void {
     $this->setProjectInstalledVersion("8.$site_patch_version");
     $this->refreshUpdateStatus([$this->updateProject => $fixture]);
     $this->assertSecurityUpdates("{$this->updateProject}-8", $expected_security_releases, $expected_update_message_type, $this->updateTableLocator);
-- 
GitLab