From daab6ad7c81b7e9e2783700a15c73f9a9374b38b Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Thu, 5 Mar 2020 09:51:51 +0000
Subject: [PATCH] Issue #3003401 by Sam152: UpdatePathTestBase calls
 setDatabaseDumpFiles twice, resulting in duplicate fixtures in some scenarios

---
 .../FunctionalTests/Update/UpdatePathTestBase.php |  2 --
 .../Update/UpdatePathTestBaseTest.php             | 15 ++++++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
index 6fa592066bdd..bf893ef8c235 100644
--- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
+++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
@@ -159,8 +159,6 @@ protected function setUp() {
     // Install Drupal test site.
     $this->prepareEnvironment();
     $this->runDbTasks();
-    // Allow classes to set database dump files.
-    $this->setDatabaseDumpFiles();
 
     // We are going to set a missing zlib requirement property for usage
     // during the performUpgrade() and tearDown() methods. Also set that the
diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php
index da25addbda71..285906f75205 100644
--- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php
@@ -23,11 +23,9 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase {
    * {@inheritdoc}
    */
   protected function setDatabaseDumpFiles() {
-    $this->databaseDumpFiles = [
-      __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz',
-      __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php',
-      __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.update-test-semver-update-n-enabled.php',
-    ];
+    $this->databaseDumpFiles[] = __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz';
+    $this->databaseDumpFiles[] = __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.update-test-schema-enabled.php';
+    $this->databaseDumpFiles[] = __DIR__ . '/../../../../modules/system/tests/fixtures/update/drupal-8.update-test-semver-update-n-enabled.php';
   }
 
   /**
@@ -212,4 +210,11 @@ public function testSchemaChecking() {
 
   }
 
+  /**
+   * Test the database fixtures are setup correctly.
+   */
+  public function testFixturesSetup() {
+    $this->assertCount(3, $this->databaseDumpFiles);
+  }
+
 }
-- 
GitLab