Revert "[TASK] Avoid slow array functions in loops"
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Tests / Functional / SiteHandling / EnhancerLinkGeneratorTest.php
index e50a703..dd0ef23 100644 (file)
@@ -507,29 +507,32 @@ class EnhancerLinkGeneratorTest extends AbstractTestCase
             'end' => '100',
         ];
 
-        $dataSet = [[]];
+        $dataSet = [];
         foreach (range(10, 100, 30) as $value) {
             $languages = [
                 '0' => sprintf('https://acme.us/welcome/enhance/%s%s', $value, $options['pathSuffix'] ?? ''),
                 '1' => sprintf('https://acme.fr/bienvenue/enhance/%s%s', $value, $options['pathSuffix'] ?? ''),
             ];
 
-            $dataSet[] = $this->createDataSet(
-                $aspect,
-                $languages,
-                $this->getEnhancers([
-                    'value' => $value,
-                    'additionalParameters' => $options['additionalParameters'] ?? ''
-                ]),
-                'value',
-                [
-                    'prefix' => 'staticRangeMapper/',
-                    'suffix' => sprintf(', value:%d', $value),
-                ],
-                array_key_exists('pageTypeSettings', $options) ? $options['pageTypeSettings'] : []
+            $dataSet = array_merge(
+                $dataSet,
+                $this->createDataSet(
+                    $aspect,
+                    $languages,
+                    $this->getEnhancers([
+                        'value' => $value,
+                        'additionalParameters' => $options['additionalParameters'] ?? ''
+                    ]),
+                    'value',
+                    [
+                        'prefix' => 'staticRangeMapper/',
+                        'suffix' => sprintf(', value:%d', $value),
+                    ],
+                    array_key_exists('pageTypeSettings', $options) ? $options['pageTypeSettings'] : []
+                )
             );
         }
-        return array_merge(...$dataSet);
+        return $dataSet;
     }
 
     /**
@@ -614,7 +617,7 @@ class EnhancerLinkGeneratorTest extends AbstractTestCase
             ]
         ];
 
-        $dataSet = [[]];
+        $dataSet = [];
         foreach ($instructions as $instruction) {
             $templateSuffix = sprintf(
                 ' [%s=>%s]',
@@ -641,9 +644,12 @@ class EnhancerLinkGeneratorTest extends AbstractTestCase
                 },
                 array_keys($dataSetCandidates)
             );
-            $dataSet[] = array_combine($dataSetCandidatesKeys, $dataSetCandidates);
+            $dataSet = array_merge(
+                $dataSet,
+                array_combine($dataSetCandidatesKeys, $dataSetCandidates)
+            );
         }
-        return array_merge(...$dataSet);
+        return $dataSet;
     }
 
     /**