Revert "[TASK] Avoid slow array functions in loops"
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Tests / Functional / Tca / ContentVisibleFieldsTest.php
index 2be2942..da8fdf7 100644 (file)
@@ -119,21 +119,20 @@ class ContentVisibleFieldsTest extends \TYPO3\TestingFramework\Core\Functional\F
         $formEngineTestService = GeneralUtility::makeInstance(FormTestService::class);
 
         foreach (static::$contentFieldsByType as $contentType => $fieldConfig) {
-            $expectedFields = [static::$commonContentFields];
+            $expectedFields = static::$commonContentFields;
 
             if (empty($fieldConfig['disableHeaderFields'])) {
-                $expectedFields[] = static::$headerFields;
+                $expectedFields = array_merge($expectedFields, static::$headerFields);
             }
 
             if (!empty($fieldConfig['useImageFields'])) {
-                $expectedFields[] = static::$imageFields;
+                $expectedFields = array_merge($expectedFields, static::$imageFields);
             }
 
             if (!empty($fieldConfig['additionalFields'])) {
-                $expectedFields[] = $fieldConfig['additionalFields'];
+                $expectedFields = array_merge($expectedFields, $fieldConfig['additionalFields']);
             }
 
-            $expectedFields = array_merge(...$expectedFields);
             $formResult = $formEngineTestService->createNewRecordForm('tt_content', ['CType' => $contentType]);
             foreach ($expectedFields as $expectedField) {
                 $this->assertNotFalse(