From c51bacbcc68c91a44de8c24ea15feee6b09de140 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Fri, 8 Mar 2019 07:17:29 +0000
Subject: [PATCH] Issue #3007606 by amateescu: Force all update path tests to
 only run one entity per batch

---
 .../src/Functional/Update/TaxonomyParentUpdateTest.php | 10 ----------
 .../FunctionalTests/Update/UpdatePathTestBase.php      |  6 ++++++
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyParentUpdateTest.php b/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyParentUpdateTest.php
index c47e3e48698a..1580b8c5cfb0 100644
--- a/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyParentUpdateTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Update/TaxonomyParentUpdateTest.php
@@ -47,16 +47,6 @@ public function setDatabaseDumpFiles() {
    * @see taxonomy_update_8503()
    */
   public function testTaxonomyUpdateParents() {
-    // Force the update hook to only run one term per batch.
-    drupal_rewrite_settings([
-      'settings' => [
-        'entity_update_batch_size' => (object) [
-          'value' => 1,
-          'required' => TRUE,
-        ],
-      ],
-    ]);
-
     // Run updates.
     $this->runUpdates();
 
diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
index 5855effb41c5..a127ab48333c 100644
--- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
+++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php
@@ -266,6 +266,12 @@ protected function prepareSettings() {
       'required' => TRUE,
     ];
 
+    // Force every update hook to only run one entity per batch.
+    $settings['entity_update_batch_size'] = (object) [
+      'value' => 1,
+      'required' => TRUE,
+    ];
+
     $this->writeSettings($settings);
   }
 
-- 
GitLab