Revert "[TASK] Avoid slow array functions in loops"
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Tests / Functional / SiteHandling / EnhancerSiteRequestTest.php
index 7d62cfb..eccb060 100644 (file)
@@ -493,7 +493,7 @@ class EnhancerSiteRequestTest extends AbstractTestCase
             'end' => '100',
         ];
 
-        $dataSet = [[]];
+        $dataSet = [];
         foreach (range(10, 100, 30) as $value) {
             $enhancerLanguageUris = $this->populateToKeys(
                 ['Simple', 'Plugin', 'Extbase'],
@@ -503,15 +503,18 @@ class EnhancerSiteRequestTest extends AbstractTestCase
                 ]
             );
 
-            $dataSet[] = $this->createDataSet(
-                $aspect,
-                $enhancerLanguageUris,
-                $this->getEnhancers(['value' => $value], true),
-                'value',
-                ['prefix' => 'staticRangeMapper/', 'suffix' => sprintf(', value:%d', $value)]
+            $dataSet = array_merge(
+                $dataSet,
+                $this->createDataSet(
+                    $aspect,
+                    $enhancerLanguageUris,
+                    $this->getEnhancers(['value' => $value], true),
+                    'value',
+                    ['prefix' => 'staticRangeMapper/', 'suffix' => sprintf(', value:%d', $value)]
+                )
             );
         }
-        return array_merge(...$dataSet);
+        return $dataSet;
     }
 
     /**
@@ -544,7 +547,7 @@ class EnhancerSiteRequestTest extends AbstractTestCase
             ['pathSuffix' => '/menu.json', 'type' => 10],
         ];
 
-        $dataSet = [[]];
+        $dataSet = [];
         foreach ($instructions as $instruction) {
             $templateSuffix = sprintf(
                 ' [%s=>%s]',
@@ -576,9 +579,12 @@ class EnhancerSiteRequestTest extends AbstractTestCase
                 },
                 array_keys($dataSetCandidates)
             );
-            $dataSet[] = array_combine($dataSetCandidatesKeys, $dataSetCandidates);
+            $dataSet = array_merge(
+                $dataSet,
+                array_combine($dataSetCandidatesKeys, $dataSetCandidates)
+            );
         }
-        return array_merge(...$dataSet);
+        return $dataSet;
     }
 
     /**