2 declare(strict_types = 1);
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
50 $this->expectException(\RuntimeException::class);
51 $this->expectExceptionCode(1482394401);
53 $subject->migrate($input);
61 $input = $expected = [
71 'lolli' =>
'did this',
77 'showitem' =>
'this,should;stay,this,too',
83 $this->assertEquals($expected, $subject->migrate($input));
100 'config' =>
'i am a string but should be an array',
138 $this->assertEquals($expected, $subject->migrate($input));
157 'type' =>
'userFunc',
158 'userFunc' =>
'TYPO3\CMS\T3editor\FormWizard->main',
159 'title' =>
't3editor',
160 'icon' =>
'content-table',
162 'name' =>
'wizard_table'
166 'style' =>
'width:98%; height: 60%;'
183 'renderType' =>
't3editor',
192 $this->assertEquals($expected, $subject->migrate($input));
204 'showitem' =>
'aField,anotherField;with;;;style-pointer,thirdField',
207 'showitem' =>
'aField,;;;;only-a-style-pointer,anotherField',
216 'showitem' =>
'aField,anotherField;with,thirdField',
219 'showitem' =>
'aField,anotherField',
225 $this->assertEquals($expected, $subject->migrate($input));
237 'showitem' =>
'aField,anotherField;with;;nowrap,thirdField',
246 'showitem' =>
'aField,anotherField;with,thirdField',
247 'columnsOverrides' => [
259 $this->assertEquals($expected, $subject->migrate($input));
271 'defaultExtras' =>
'nowrap',
279 'showitem' =>
'aField,anotherField;with;;enable-tab,thirdField',
296 'showitem' =>
'aField,anotherField;with,thirdField',
297 'columnsOverrides' => [
301 'enableTabulator' =>
true,
310 $this->assertEquals($expected, $subject->migrate($input));
329 'type' =>
'userFunc',
330 'userFunc' =>
'TYPO3\CMS\T3editor\FormWizard->main',
331 'enableByTypeConfig' => 1,
332 'title' =>
't3editor',
333 'icon' =>
'content-table',
335 'name' =>
'wizard_table'
339 'style' =>
'width:98%; height: 60%;'
342 't3editorTypoScript' => [
343 'type' =>
'userFunc',
344 'userFunc' =>
'TYPO3\CMS\T3editor\FormWizard->main',
345 'enableByTypeConfig' => 1,
346 'title' =>
't3editor',
347 'icon' =>
'content-table',
349 'name' =>
'wizard_table'
352 'format' =>
'typoscript',
353 'style' =>
'width:98%; height: 60%;'
362 'showitem' =>
'foo,bodytext;;;wizards[t3editorTypoScript|someOtherWizard],bar',
365 'showitem' =>
'foo,bodytext;;;nowrap:wizards[t3editorHtml], bar',
384 'showitem' =>
'foo,bodytext,bar',
385 'columnsOverrides' => [
388 'format' =>
'typoscript',
389 'renderType' =>
't3editor',
395 'showitem' =>
'foo,bodytext,bar',
396 'columnsOverrides' => [
400 'renderType' =>
't3editor',
410 $this->assertEquals($expected, $subject->migrate($input));
429 'type' =>
'userFunc',
430 'userFunc' =>
'TYPO3\CMS\T3editor\FormWizard->main',
431 'enableByTypeConfig' => 1,
432 'title' =>
't3editor',
433 'icon' =>
'content-table',
435 'name' =>
'wizard_table'
439 'style' =>
'width:98%; height: 60%;'
463 $this->assertEquals($expected, $subject->migrate($input));
482 'showitem' =>
'aField;;;',
489 $subject->migrate($input);
490 $this->assertEmpty($subject->getMessages());
502 'showitem' =>
'field1;field1Label,field2;fieldLabel2;palette1,field2;;palette2',
511 'showitem' =>
'field1;field1Label,field2;fieldLabel2,--palette--;;palette1,field2,--palette--;;palette2',
517 $this->assertEquals($expected, $subject->migrate($input));
533 'icon' =>
'wizard_table.gif',
550 'icon' =>
'content-table',
560 $this->assertEquals($expected, $subject->migrate($input));
575 [
'foo', 0,
'ext/myext/foo/bar.gif'],
576 [
'bar', 1,
'sysext/myext/foo/bar.gif'],
590 'renderType' =>
'selectSingle',
592 [
'foo', 0,
'EXT:myext/foo/bar.gif'],
593 [
'bar', 1,
'EXT:myext/foo/bar.gif'],
602 $this->assertEquals($expected, $subject->migrate($input));
617 [
'foo', 0,
'i/tt_content.gif'],
631 'renderType' =>
'selectSingle',
633 [
'foo', 0,
'EXT:backend/Resources/Public/Images/tt_content.gif'],
642 $this->assertEquals($expected, $subject->migrate($input));
656 'iconsInOptionTags' => 1,
668 'renderType' =>
'selectSingle',
676 $this->assertEquals($expected, $subject->migrate($input));
687 'iconfile' =>
'../typo3conf/ext/myExt/iconfile.gif',
694 'iconfile' =>
'EXT:myExt/iconfile.gif',
699 $this->assertEquals($expected, $subject->migrate($input));
710 'iconfile' =>
'iconfile.gif',
717 'iconfile' =>
'EXT:backend/Resources/Public/Images/iconfile.gif',
722 $this->assertEquals($expected, $subject->migrate($input));
733 'iconfile' =>
'EXT:myExt/iconfile.gif',
740 'iconfile' =>
'EXT:myExt/iconfile.gif',
745 $this->assertEquals($expected, $subject->migrate($input));
754 'aTable-do-not-migrate-because-renderType-is-set' => [
759 'renderType' =>
'fooBar'
764 'aTable-do-migrate-because-renderType-is-not-set' => [
769 'renderMode' =>
'tree'
772 'a-singlebox-column' => [
775 'renderMode' =>
'singlebox'
778 'a-checkbox-column' => [
781 'renderMode' =>
'checkbox'
784 'an-unknown-column' => [
787 'renderMode' =>
'unknown'
790 'a-maxitems-column-not-set' => [
795 'a-maxitems-column-0' => [
801 'a-maxitems-column-1' => [
807 'a-maxitems-column-2' => [
813 'a-tree-column-with-maxitems' => [
816 'renderMode' =>
'tree',
820 'a-singlebox-column-with-maxitems' => [
823 'renderMode' =>
'singlebox',
827 'a-checkbox-column-with-maxitems' => [
830 'renderMode' =>
'checkbox',
838 'aTable-do-not-migrate-because-renderType-is-set' => [
843 'renderType' =>
'fooBar'
848 'aTable-do-migrate-because-renderType-is-not-set' => [
853 'renderMode' =>
'tree',
854 'renderType' =>
'selectTree'
857 'a-singlebox-column' => [
860 'renderMode' =>
'singlebox',
861 'renderType' =>
'selectSingleBox'
864 'a-checkbox-column' => [
867 'renderMode' =>
'checkbox',
868 'renderType' =>
'selectCheckBox'
871 'an-unknown-column' => [
874 'renderMode' =>
'unknown'
877 'a-maxitems-column-not-set' => [
880 'renderType' =>
'selectSingle'
883 'a-maxitems-column-0' => [
887 'renderType' =>
'selectSingle'
890 'a-maxitems-column-1' => [
894 'renderType' =>
'selectSingle'
897 'a-maxitems-column-2' => [
901 'renderType' =>
'selectMultipleSideBySide'
904 'a-tree-column-with-maxitems' => [
907 'renderMode' =>
'tree',
908 'renderType' =>
'selectTree',
912 'a-singlebox-column-with-maxitems' => [
915 'renderMode' =>
'singlebox',
916 'renderType' =>
'selectSingleBox',
920 'a-checkbox-column-with-maxitems' => [
923 'renderMode' =>
'checkbox',
924 'renderType' =>
'selectCheckBox',
932 $this->assertEquals($expected, $subject->migrate($input));
941 'not-a-select-is-kept' => [
951 'not-a-selectSingle-is-kept' => [
954 'renderType' =>
'selectCheckBox',
958 'renderType' =>
'selectCheckBox',
961 'noIconsBelowSelect-true-is-removed' => [
964 'renderType' =>
'selectSingle',
965 'noIconsBelowSelect' =>
true,
969 'renderType' =>
'selectSingle',
972 'noIconsBelowSelect-false-is-removed-sets-field-wizard' => [
975 'renderType' =>
'selectSingle',
976 'noIconsBelowSelect' =>
false,
980 'renderType' =>
'selectSingle',
988 'noIconsBelowSelect-false-is-removes-given-showIconTable-false' => [
991 'renderType' =>
'selectSingle',
992 'noIconsBelowSelect' =>
false,
993 'showIconTable' =>
false,
997 'renderType' =>
'selectSingle',
1000 'suppress-icons-1-is-removed' => [
1003 'renderType' =>
'selectSingle',
1004 'suppress_icons' =>
'1',
1008 'renderType' =>
'selectSingle',
1011 'suppress-icons-value-is-removed' => [
1014 'renderType' =>
'selectSingle',
1015 'suppress_icons' =>
'IF_VALUE_FALSE',
1019 'renderType' =>
'selectSingle',
1022 'selicon-cols-is-removed' => [
1025 'renderType' =>
'selectSingle',
1026 'selicon_cols' => 16,
1030 'renderType' =>
'selectSingle',
1033 'foreign_table_loadIcons-is-removed' => [
1036 'renderType' =>
'selectSingle',
1037 'foreign_table_loadIcons' =>
true,
1041 'renderType' =>
'selectSingle',
1059 'config' => $givenConfig,
1065 $expected[
'aTable'][
'columns'][
'aField'][
'config'] = $expectedConfig;
1068 $this->assertEquals($expected, $subject->migrate($input));
1085 'name' =>
'wizard_element_browser',
1086 'urlParameters' => [
1106 'name' =>
'wizard_link',
1117 $this->assertEquals($expected, $subject->migrate($input));
1126 'columns richtext configuration' => [
1135 'defaultExtras' =>
'richtext:rte_transform[]'
1147 'enableRichtext' =>
true,
1148 'richtextConfiguration' =>
'default',
1155 'columns richtext configuration without bracket' => [
1163 'defaultExtras' =>
'richtext:rte_transform'
1174 'enableRichtext' =>
true,
1175 'richtextConfiguration' =>
'default',
1182 'columns richtext with mode' => [
1190 'defaultExtras' =>
'richtext:rte_transform[mode=ts_css]'
1201 'enableRichtext' =>
true,
1202 'richtextConfiguration' =>
'default',
1209 'columns richtext with mode and others' => [
1217 'defaultExtras' =>
'richtext:rte_transform[flag=rte_enabled|mode=ts_css]'
1228 'enableRichtext' =>
true,
1229 'richtextConfiguration' =>
'default',
1236 'columns richtext with array with mode and others' => [
1244 'defaultExtras' =>
'richtext[]:rte_transform[flag=rte_enabled|mode=ts_css]'
1255 'enableRichtext' =>
true,
1256 'richtextConfiguration' =>
'default',
1263 'columns richtext * with mode and others' => [
1271 'defaultExtras' =>
'richtext[*]:rte_transform[flag=rte_enabled|mode=ts_css]'
1282 'enableRichtext' =>
true,
1283 'richtextConfiguration' =>
'default',
1290 'columns richtext cut-copy-paste with mode and others' => [
1298 'defaultExtras' =>
'richtext[cut|copy|paste]:rte_transform[flag=rte_enabled|mode=ts_css]'
1309 'enableRichtext' =>
true,
1310 'richtextConfiguration' =>
'default',
1317 'columnsOverrides richtext with brackets' => [
1329 'columnsOverrides' => [
1331 'defaultExtras' =>
'richtext:rte_transform[]'
1349 'columnsOverrides' => [
1352 'enableRichtext' =>
true,
1353 'richtextConfiguration' =>
'default',
1362 'columnsOverrides richtext' => [
1374 'columnsOverrides' => [
1376 'defaultExtras' =>
'richtext:rte_transform'
1394 'columnsOverrides' => [
1397 'enableRichtext' =>
true,
1398 'richtextConfiguration' =>
'default',
1407 'columnsOverrides richtext with defalut mode' => [
1419 'columnsOverrides' => [
1421 'defaultExtras' =>
'richtext:rte_transform[mode=ts_css]'
1439 'columnsOverrides' => [
1442 'enableRichtext' =>
true,
1443 'richtextConfiguration' =>
'default',
1452 'columnsOverrides richtext with mode and others' => [
1464 'columnsOverrides' => [
1466 'defaultExtras' =>
'richtext:rte_transform[flag=rte_enabled|mode=ts_css]'
1484 'columnsOverrides' => [
1487 'enableRichtext' =>
true,
1488 'richtextConfiguration' =>
'default',
1497 'columnsOverrides richtext brackets mode and others' => [
1509 'columnsOverrides' => [
1511 'defaultExtras' =>
'richtext[]:rte_transform[flag=rte_enabled|mode=ts_css]'
1529 'columnsOverrides' => [
1532 'enableRichtext' =>
true,
1533 'richtextConfiguration' =>
'default',
1542 'columnsOverrides richtext star with mode and others' => [
1554 'columnsOverrides' => [
1556 'defaultExtras' =>
'richtext[*]:rte_transform[flag=rte_enabled|mode=ts_css]'
1574 'columnsOverrides' => [
1577 'enableRichtext' =>
true,
1578 'richtextConfiguration' =>
'default',
1587 'columnsOverrides richtext cut-copy-paste ith mode and others' => [
1599 'columnsOverrides' => [
1601 'defaultExtras' =>
'richtext[copy|cut|paste]:rte_transform[flag=rte_enabled|mode=ts_css]'
1619 'columnsOverrides' => [
1622 'enableRichtext' =>
true,
1623 'richtextConfiguration' =>
'default',
1644 $this->assertEquals($expectedConfig, $subject->migrate($givenConfig));
1661 'renderType' =>
'selectTree',
1679 'renderType' =>
'selectTree',
1690 'remove allowRecursiveMode' => [
1698 'renderType' =>
'selectTree',
1701 'someKey' =>
'value',
1702 'allowRecursiveMode' => true
1717 'renderType' =>
'selectTree',
1720 'someKey' =>
'value'
1729 'move autoSizeMax to size' => [
1737 'renderType' =>
'selectTree',
1738 'autoSizeMax' => 20,
1752 'renderType' =>
'selectTree',
1760 'keep settings for non selectTree' => [
1768 'renderType' =>
'not a select tree',
1769 'autoSizeMax' => 20,
1773 'someKey' =>
'value',
1774 'allowRecursiveMode' =>
true,
1790 'renderType' =>
'not a select tree',
1791 'autoSizeMax' => 20,
1795 'someKey' =>
'value',
1796 'allowRecursiveMode' =>
true,
1818 $this->assertEquals($expected, $subject->migrate($input));
1827 'nothing removed' => [
1834 'softref' =>
'email,somethingelse'
1846 'softref' =>
'email,somethingelse',
1853 'TStemplate only' => [
1860 'softref' =>
'TStemplate,somethingelse'
1872 'softref' =>
'somethingelse',
1879 'TStemplate and TSconfig' => [
1886 'softref' =>
'TStemplate,somethingelse,TSconfig'
1898 'softref' =>
'somethingelse',
1917 $this->assertEquals($expectedConfig, $subject->migrate($givenConfig));
1926 'nothing removed' => [
1950 'Option removed' => [
1957 'showIfRTE' => false
1988 $this->assertEquals($expectedConfig, $subject->migrate($givenConfig));
1997 'no workspaces enabled' => [
2001 'versioningWS' => false
2008 'versioningWS' => false
2013 'nothing activated' => [
2029 'nothing changed, workspaces enabled' => [
2033 'versioningWS' => true
2040 'versioningWS' => true
2045 'cast workspaces to bool' => [
2056 'versioningWS' => true
2061 'cast workspaces v2 to bool' => [
2072 'versioningWS' => true
2077 'cast workspaces v2 to bool and remove followpages' => [
2081 'versioningWS' => 2,
2082 'versioning_followPages' => true
2089 'versioningWS' => true
2106 $this->assertEquals($expectedConfig, $subject->migrate($givenConfig));
2115 'remove transForeignTable' => [
2119 'transForeignTable' =>
'pages_language_overlay',
2129 'remove transOrigPointerTable' => [
2133 'transOrigPointerTable' =>
'pages',
2155 $this->assertEquals($expectedConfig, $subject->migrate($givenConfig));
2164 'remove l10n_mode noCopy' => [
2169 'l10n_mode' =>
'noCopy',
2189 'remove l10n_mode mergeIfNotBlank' => [
2194 'l10n_mode' =>
'mergeIfNotBlank',
2209 'allowLanguageSynchronization' =>
true,
2229 $this->assertEquals($expectedConfig, $subject->migrate($givenConfig));
2238 'missing l10n_mode' => [
2249 'pages_language_overlay' => [
2255 'l10n_mode' =>
'any-possible-value',
2267 'l10n_mode' =>
'any-possible-value',
2273 'missing allowLanguageSynchronization' => [
2284 'pages_language_overlay' => [
2290 'allowLanguageSynchronization' =>
true,
2304 'allowLanguageSynchronization' =>
true,
2324 $this->assertEquals($expectedConfig, $subject->migrate($givenConfig));
2333 'remove counter-productive localizationMode=keep' => [
2341 'localizationMode' =>
'keep',
2342 'allowLanguageSynchronization' =>
true,
2356 'allowLanguageSynchronization' =>
true,
2364 'keep deprecated localizationMode=keep' => [
2372 'localizationMode' =>
'keep',
2386 'localizationMode' =>
'keep',
2394 'keep deprecated localizationMode=select' => [
2402 'localizationMode' =>
'select',
2416 'localizationMode' =>
'select',
2436 $this->assertEquals($expectedConfig, $subject->migrate($givenConfig));
2437 $this->assertNotEmpty($subject->getMessages());
2446 'move single field name' => [
2450 'requestUpdate' =>
'aField',
2471 'onChange' =>
'reload',
2477 'ignore missing field but migrate others' => [
2481 'requestUpdate' =>
'aField, bField, cField, ',
2505 'onChange' =>
'reload',
2511 'onChange' =>
'reload',
2528 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
2537 'simple input with eval date' => [
2559 'renderType' =>
'inputDateTime',
2566 'simple input with eval datetime' => [
2574 'eval' =>
'datetime',
2587 'eval' =>
'datetime',
2588 'renderType' =>
'inputDateTime',
2595 'simple input with eval time' => [
2617 'renderType' =>
'inputDateTime',
2624 'simple input with eval timesec' => [
2632 'eval' =>
'timesec',
2645 'eval' =>
'timesec',
2646 'renderType' =>
'inputDateTime',
2653 'input with multiple evals' => [
2661 'eval' =>
'null,date, required',
2674 'eval' =>
'null,date, required',
2675 'renderType' =>
'inputDateTime',
2693 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
2702 'enableByTypeConfig on multiple wizards' => [
2708 'label' =>
'aLabel',
2714 'title' =>
'aTitle',
2715 'enableByTypeConfig' =>
'1',
2717 'anotherWizard' => [
2719 'title' =>
'anotherTitle',
2720 'enableByTypeConfig' => 1,
2722 'yetAnotherWizard' => [
2724 'title' =>
'yetAnotherTitle',
2726 'andYetAnotherWizard' => [
2728 'title' =>
'yetAnotherTitle',
2729 'enableByTypeConfig' => 0,
2737 'columnsOverrides' => [
2739 'defaultExtras' =>
'nowrap:wizards[aWizard|anotherWizard|aNotExistingWizard]:enable-tab',
2744 'columnsOverrides' => [
2746 'defaultExtras' =>
'wizards[aWizard]',
2758 'label' =>
'aLabel',
2762 'yetAnotherWizard' => [
2764 'title' =>
'yetAnotherTitle',
2766 'andYetAnotherWizard' => [
2768 'title' =>
'yetAnotherTitle',
2776 'columnsOverrides' => [
2780 'enableTabulator' =>
true,
2784 'title' =>
'aTitle',
2786 'anotherWizard' => [
2788 'title' =>
'anotherTitle',
2796 'columnsOverrides' => [
2802 'title' =>
'aTitle',
2813 'empty wizard array is removed' => [
2819 'label' =>
'aLabel',
2825 'title' =>
'aTitle',
2826 'enableByTypeConfig' => 1,
2834 'columnsOverrides' => [
2836 'defaultExtras' =>
'wizards[aWizard]',
2848 'label' =>
'aLabel',
2856 'columnsOverrides' => [
2862 'title' =>
'aTitle',
2884 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
2893 'colorpicker in columns field' => [
2902 'type' =>
'colorbox',
2903 'title' =>
'Color picker',
2905 'name' =>
'wizard_colorpicker',
2907 'JSopenParams' =>
'height=300,width=500,status=0,menubar=0,scrollbars=1',
2921 'renderType' =>
'colorpicker',
2928 'colorpicker is not migrated if custom renderType is already given' => [
2935 'renderType' =>
'myPersonalRenderType',
2938 'type' =>
'colorbox',
2939 'title' =>
'Color picker',
2941 'name' =>
'wizard_colorpicker',
2943 'JSopenParams' =>
'height=300,width=500,status=0,menubar=0,scrollbars=1',
2957 'renderType' =>
'myPersonalRenderType',
2960 'type' =>
'colorbox',
2961 'title' =>
'Color picker',
2963 'name' =>
'wizard_colorpicker',
2965 'JSopenParams' =>
'height=300,width=500,status=0,menubar=0,scrollbars=1',
2974 'colorpicker in a type columnsOverrides field' => [
2986 'columnsOverrides' => [
2991 'type' =>
'colorbox',
2992 'title' =>
'Color picker',
2994 'name' =>
'wizard_colorpicker',
2996 'JSopenParams' =>
'height=300,width=500,status=0,menubar=0,scrollbars=1',
3017 'columnsOverrides' => [
3021 'renderType' =>
'colorpicker',
3041 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
3050 'select wizard without mode' => [
3059 'target_picker' => [
3062 [
'aLabel',
'aValue' ],
3063 [
'anotherLabel',
'anotherValue' ],
3081 [
'aLabel',
'aValue' ],
3082 [
'anotherLabel',
'anotherValue' ],
3091 'select wizard with empty mode' => [
3100 'target_picker' => [
3104 [
'aLabel',
'aValue' ],
3105 [
'anotherLabel',
'anotherValue' ],
3124 [
'aLabel',
'aValue' ],
3125 [
'anotherLabel',
'anotherValue' ],
3134 'select wizard with prepend mode' => [
3143 'target_picker' => [
3145 'mode' =>
'prepend',
3147 [
'aLabel',
'aValue' ],
3148 [
'anotherLabel',
'anotherValue' ],
3165 'mode' =>
'prepend',
3167 [
'aLabel',
'aValue' ],
3168 [
'anotherLabel',
'anotherValue' ],
3177 'select wizard with append mode' => [
3186 'target_picker' => [
3190 [
'aLabel',
'aValue' ],
3191 [
'anotherLabel',
'anotherValue' ],
3210 [
'aLabel',
'aValue' ],
3211 [
'anotherLabel',
'anotherValue' ],
3220 'select wizard with broken mode' => [
3229 'target_picker' => [
3233 [
'aLabel',
'aValue' ],
3234 [
'anotherLabel',
'anotherValue' ],
3252 [
'aLabel',
'aValue' ],
3253 [
'anotherLabel',
'anotherValue' ],
3262 'select wizard without items is not migrated' => [
3271 'target_picker' => [
3289 'target_picker' => [
3300 'select wizard with broken items is not migrated' => [
3309 'target_picker' => [
3328 'target_picker' => [
3349 'target_picker' => [
3353 [
'aLabel',
'aValue' ],
3354 [
'anotherLabel',
'anotherValue' ],
3357 'differentWizard' => [
3376 [
'aLabel',
'aValue' ],
3377 [
'anotherLabel',
'anotherValue' ],
3381 'differentWizard' => [
3391 'select value wizard to value Picker columnsOverrides field' => [
3403 'columnsOverrides' => [
3407 'target_picker' => [
3410 [
'aLabel',
'aValue' ],
3411 [
'anotherLabel',
'anotherValue' ],
3433 'columnsOverrides' => [
3438 [
'aLabel',
'aValue' ],
3439 [
'anotherLabel',
'anotherValue' ],
3461 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
3470 'slider wizard with no options' => [
3502 'slider wizard with options' => [
3552 'differentWizard' => [
3572 'differentWizard' => [
3582 'slider wizard to columnsOverrides field' => [
3594 'columnsOverrides' => [
3602 'differentWizard' => [
3624 'columnsOverrides' => [
3631 'differentWizard' => [
3654 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
3663 'simple link wizard without options' => [
3675 'name' =>
'wizard_link',
3691 'renderType' =>
'inputLink',
3698 'link wizard with options' => [
3709 'title' =>
'aLinkTitle',
3711 'name' =>
'wizard_link',
3713 'JSopenParams' =>
'height=800,width=600,status=0,menubar=0,scrollbars=1',
3715 'blindLinkOptions' =>
'folder',
3716 'blindLinkFields' =>
'class, target',
3717 'allowedExtensions' =>
'jpg',
3733 'renderType' =>
'inputLink',
3737 'title' =>
'aLinkTitle',
3738 'windowOpenParameters' =>
'height=800,width=600,status=0,menubar=0,scrollbars=1',
3739 'blindLinkOptions' =>
'folder',
3740 'blindLinkFields' =>
'class, target',
3741 'allowedExtensions' =>
'jpg',
3751 'link wizard does not migrate if renderType is already set' => [
3759 'renderType' =>
'aRenderType',
3764 'name' =>
'wizard_link',
3780 'renderType' =>
'aRenderType',
3785 'name' =>
'wizard_link',
3807 'name' =>
'wizard_link',
3810 'differentWizard' => [
3826 'renderType' =>
'inputLink',
3828 'differentWizard' => [
3838 'link wizard columnsOverrides field' => [
3850 'columnsOverrides' => [
3856 'title' =>
'aLinkTitle',
3858 'name' =>
'wizard_link',
3860 'JSopenParams' =>
'height=800,width=600,status=0,menubar=0,scrollbars=1',
3862 'blindLinkOptions' =>
'folder',
3863 'blindLinkFields' =>
'class, target',
3864 'allowedExtensions' =>
'jpg',
3867 'differentWizard' => [
3889 'columnsOverrides' => [
3892 'renderType' =>
'inputLink',
3896 'title' =>
'aLinkTitle',
3897 'windowOpenParameters' =>
'height=800,width=600,status=0,menubar=0,scrollbars=1',
3898 'blindLinkOptions' =>
'folder',
3899 'blindLinkFields' =>
'class, target',
3900 'allowedExtensions' =>
'jpg',
3905 'differentWizard' => [
3928 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
3937 'simple link wizard without options' => [
3949 'name' =>
'wizard_edit',
3951 'icon' =>
'actions-open',
3968 'disabled' =>
false,
3977 'simple link wizard with options' => [
3985 'renderType' =>
'selectMultipleSideBySide',
3989 'title' =>
'aLabel',
3991 'name' =>
'wizard_edit',
3993 'popup_onlyOpenIfSelected' => 1,
3994 'icon' =>
'actions-open',
3995 'JSopenParams' =>
'height=350,width=580,status=0,menubar=0,scrollbars=1'
4010 'renderType' =>
'selectMultipleSideBySide',
4013 'disabled' =>
false,
4015 'title' =>
'aLabel',
4016 'windowOpenParameters' =>
'height=350,width=580,status=0,menubar=0,scrollbars=1',
4026 'edit wizard in columnsOverrides' => [
4039 'columnsOverrides' => [
4045 'title' =>
'aLabel',
4047 'name' =>
'wizard_edit',
4049 'icon' =>
'actions-open',
4071 'columnsOverrides' => [
4076 'disabled' =>
false,
4078 'title' =>
'aLabel',
4101 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
4110 'simple add wizard without options' => [
4122 'name' =>
'wizard_add',
4124 'icon' =>
'actions-add',
4141 'disabled' =>
false,
4150 'simple add wizard with options' => [
4158 'renderType' =>
'selectMultipleSideBySide',
4162 'title' =>
'aLabel',
4164 'name' =>
'wizard_add',
4166 'icon' =>
'actions-add',
4168 'table' =>
'aTable',
4170 'setValue' =>
'prepend',
4186 'renderType' =>
'selectMultipleSideBySide',
4189 'disabled' =>
false,
4191 'title' =>
'aLabel',
4192 'table' =>
'aTable',
4194 'setValue' =>
'prepend',
4204 'add wizard in columnsOverrides' => [
4217 'columnsOverrides' => [
4223 'title' =>
'aLabel',
4225 'name' =>
'wizard_add',
4227 'icon' =>
'actions-add',
4229 'table' =>
'aTable',
4231 'setValue' =>
'prepend',
4254 'columnsOverrides' => [
4259 'disabled' =>
false,
4261 'title' =>
'aLabel',
4262 'table' =>
'aTable',
4264 'setValue' =>
'prepend',
4287 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
4296 'simple list wizard without options' => [
4308 'name' =>
'wizard_list',
4310 'icon' =>
'actions-system-list-open',
4327 'disabled' =>
false,
4336 'simple list wizard with options' => [
4344 'renderType' =>
'selectMultipleSideBySide',
4348 'title' =>
'aLabel',
4350 'name' =>
'wizard_list',
4352 'icon' =>
'actions-system-list-open',
4354 'table' =>
'aTable',
4371 'renderType' =>
'selectMultipleSideBySide',
4374 'disabled' =>
false,
4376 'title' =>
'aLabel',
4377 'table' =>
'aTable',
4388 'list wizard in columnsOverrides' => [
4401 'columnsOverrides' => [
4407 'title' =>
'aLabel',
4409 'name' =>
'wizard_list',
4411 'icon' =>
'actions-system-list-open',
4413 'table' =>
'aTable',
4437 'columnsOverrides' => [
4442 'disabled' =>
false,
4444 'title' =>
'aLabel',
4445 'table' =>
'aTable',
4469 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
4478 'rte_only is removed' => [
4487 'defaultExtras' =>
'rte-only',
4505 'rte_only is removed in columnsOverrides' => [
4511 'columnsOverrides' => [
4513 'defaultExtras' =>
'rte-only',
4525 'columnsOverrides' => [
4533 'enable-tab, fixed-font, nowrap is migrated' => [
4542 'defaultExtras' =>
'enable-tab : fixed-font:nowrap',
4554 'enableTabulator' =>
true,
4555 'fixedFont' =>
true,
4563 'enable-tab, fixed-font, nowrap is migrated in columnsOverrides' => [
4569 'columnsOverrides' => [
4571 'defaultExtras' =>
'enable-tab : fixed-font:nowrap',
4583 'columnsOverrides' => [
4586 'enableTabulator' =>
true,
4587 'fixedFont' =>
true,
4608 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
4617 'simple table wizard without options' => [
4628 'icon' =>
'content-table',
4630 'name' =>
'wizard_table'
4632 'notNewRecords' => 1,
4647 'renderType' =>
'textTable',
4654 'simple table wizard without options in columnsOverrides' => [
4666 'columnsOverrides' => [
4672 'icon' =>
'content-table',
4674 'name' =>
'wizard_table'
4676 'notNewRecords' => 1,
4697 'columnsOverrides' => [
4700 'renderType' =>
'textTable',
4709 'simple table wizard with default options' => [
4720 'icon' =>
'content-table',
4722 'name' =>
'wizard_table'
4727 'notNewRecords' => 1,
4742 'renderType' =>
'textTable',
4749 'simple table wizard with default options in columnsOverrides' => [
4761 'columnsOverrides' => [
4767 'icon' =>
'content-table',
4769 'name' =>
'wizard_table'
4774 'notNewRecords' => 1,
4795 'columnsOverrides' => [
4798 'renderType' =>
'textTable',
4807 'simple table wizard with options' => [
4818 'title' =>
'aTitle',
4819 'icon' =>
'content-table',
4821 'name' =>
'wizard_table'
4827 'notNewRecords' => 1,
4842 'renderType' =>
'textTable',
4846 'title' =>
'aTitle',
4858 'simple table wizard with options in columnsOverrides' => [
4870 'columnsOverrides' => [
4876 'title' =>
'aTitle',
4877 'icon' =>
'content-table',
4879 'name' =>
'wizard_table'
4885 'notNewRecords' => 1,
4906 'columnsOverrides' => [
4909 'renderType' =>
'textTable',
4913 'title' =>
'aTitle',
4938 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
4947 'simple rte wizard' => [
4955 'enableRichtext' =>
true,
4958 'notNewRecords' =>
true,
4961 'title' =>
'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext.W.RTE',
4962 'icon' =>
'actions-wizard-rte',
4964 'name' =>
'wizard_rte'
4980 'enableRichtext' =>
true,
4982 'fullScreenRichtext' => [
4983 'disabled' =>
false,
4985 'title' =>
'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext.W.RTE',
4995 'wizard is moved to columnsOverrides if enableRichtext is not set on columns' => [
5005 'notNewRecords' =>
true,
5008 'icon' =>
'actions-wizard-rte',
5010 'name' =>
'wizard_rte'
5019 'columnsOverrides' => [
5022 'enableRichtext' =>
true,
5028 'columnsOverrides' => [
5031 'someProperty' =>
'someValue',
5051 'columnsOverrides' => [
5054 'enableRichtext' =>
true,
5056 'fullScreenRichtext' => [
5057 'disabled' =>
false,
5065 'columnsOverrides' => [
5068 'someProperty' =>
'someValue',
5077 'simple rte wizard in columnsOverrides' => [
5089 'columnsOverrides' => [
5094 'notNewRecords' =>
true,
5097 'title' =>
'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext.W.RTE',
5098 'icon' =>
'actions-wizard-rte',
5100 'name' =>
'wizard_rte'
5122 'columnsOverrides' => [
5126 'fullScreenRichtext' => [
5127 'disabled' =>
false,
5129 'title' =>
'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext.W.RTE',
5152 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
5161 'no suggest wizard in main field but configured in columnsOverrides' => [
5168 'internal_type' =>
'db',
5169 'allowed' =>
'aTable',
5175 'columnsOverrides' => [
5180 'type' =>
'suggest',
5196 'internal_type' =>
'db',
5197 'allowed' =>
'aTable',
5198 'hideSuggest' =>
true,
5204 'columnsOverrides' => [
5207 'hideSuggest' =>
false,
5216 'no suggest wizard in main field but configured in columnsOverrides with options' => [
5223 'internal_type' =>
'db',
5224 'allowed' =>
'aTable',
5230 'columnsOverrides' => [
5235 'type' =>
'suggest',
5237 'minimumCharacters' => 23,
5240 'searchCondition' =>
'doktype = 1'
5257 'internal_type' =>
'db',
5258 'allowed' =>
'aTable',
5259 'hideSuggest' =>
true,
5265 'columnsOverrides' => [
5268 'hideSuggest' =>
false,
5269 'suggestOptions' => [
5271 'minimumCharacters' => 23,
5274 'searchCondition' =>
'doktype = 1'
5285 'suggest wizard configured without options' => [
5292 'internal_type' =>
'db',
5293 'allowed' =>
'aTable',
5296 'type' =>
'suggest',
5310 'internal_type' =>
'db',
5311 'allowed' =>
'aTable',
5318 'suggest wizard with options' => [
5325 'internal_type' =>
'db',
5326 'allowed' =>
'aTable',
5329 'type' =>
'suggest',
5331 'minimumCharacters' => 23,
5332 'anOption' =>
'anOptionValue',
5347 'internal_type' =>
'db',
5348 'allowed' =>
'aTable',
5349 'suggestOptions' => [
5351 'minimumCharacters' => 23,
5352 'anOption' =>
'anOptionValue',
5361 'suggest wizard with table specific options' => [
5368 'internal_type' =>
'db',
5369 'allowed' =>
'aTable',
5372 'type' =>
'suggest',
5374 'minimumCharacters' => 23,
5377 'searchCondition' =>
'doktype = 1'
5392 'internal_type' =>
'db',
5393 'allowed' =>
'aTable',
5394 'suggestOptions' => [
5396 'minimumCharacters' => 23,
5399 'searchCondition' =>
'doktype = 1'
5419 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
5428 'selectedListStyle is dropped' => [
5435 'selectedListStyle' =>
'data-foo: bar',
5453 'show_thumbs true is dropped' => [
5460 'show_thumbs' =>
true,
5478 'show_thumbs false internal_type db disables tableList' => [
5485 'internal_type' =>
'db',
5486 'show_thumbs' =>
false,
5498 'internal_type' =>
'db',
5500 'recordsOverview' => [
5510 'show_thumbs false internal_type file disables fileThumbnails' => [
5517 'internal_type' =>
'file',
5518 'show_thumbs' =>
false,
5530 'internal_type' =>
'file',
5532 'fileThumbnails' => [
5542 'disable_controls browser sets fieldControl elementBrowser disabled' => [
5549 'disable_controls' =>
'browser',
5562 'elementBrowser' => [
5572 'disable_controls list is dropped' => [
5579 'disable_controls' =>
'list,browser',
5592 'elementBrowser' => [
5602 'disable_controls delete sets hideDeleteIcon true' => [
5609 'disable_controls' =>
'delete',
5621 'hideDeleteIcon' =>
true,
5628 'disable_controls allowedTables sets fieldWizard tableList disabled' => [
5635 'disable_controls' =>
'allowedTables',
5658 'disable_controls upload sets fieldWizard fileUpload disabled' => [
5665 'disable_controls' =>
'upload',
5699 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
5708 'showIconTable enabled selectIcons field wizard' => [
5715 'renderType' =>
'selectSingle',
5716 'showIconTable' =>
true,
5728 'renderType' =>
'selectSingle',
5731 'disabled' =>
false,
5740 'selicon_cols is removed' => [
5747 'renderType' =>
'selectSingle',
5748 'selicon_cols' => 4,
5760 'renderType' =>
'selectSingle',
5778 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
5787 'enableZoom is removed' => [
5793 'type' =>
'imageManipulation',
5794 'enableZoom' =>
true,
5805 'type' =>
'imageManipulation',
5812 'ratios migration ignored if cropVariants config is present' => [
5818 'type' =>
'imageManipulation',
5822 'cropVariants' => [],
5833 'type' =>
'imageManipulation',
5834 'cropVariants' => [],
5841 'ratios are migrated' => [
5847 'type' =>
'imageManipulation',
5849 '1.3333333333333333' =>
'4:3',
5850 '1.7777777777777777' =>
'16:9',
5863 'type' =>
'imageManipulation',
5866 'title' =>
'LLL:EXT:core/Resources/Private/Language/locallang_wizards.xlf:imwizard.crop_variant.default',
5867 'allowedAspectRatios' => [
5906 $this->assertEquals($expected, (
new TcaMigration())->migrate($input));
5939 $this->assertEquals($expected, $subject->migrate($input));
5953 'renderType' =>
'fooBar'
5966 'renderType' =>
'fooBar'
5974 $this->assertEquals($expected, $subject->migrate($input));
5988 'renderType' =>
'inputDateTime'
6001 'renderType' =>
'inputDateTime'
6009 $this->assertEquals($expected, $subject->migrate($input));
6023 'renderType' =>
'inputDateTime',
6037 'renderType' =>
'inputDateTime',
6045 $this->assertEquals($expected, $subject->migrate($input));
6080 $this->assertEquals($expected, $subject->migrate($input));
6094 'renderType' =>
'fooBar',
6108 'renderType' =>
'fooBar',
6117 $this->assertEquals($expected, $subject->migrate($input));
6131 'foreign_types' => [
6147 'overrideChildTca' => [
6160 $this->assertEquals($expected, $subject->migrate($input));
6174 'foreign_types' => [
6177 'showitem' =>
'doesNotOverrideExistingSetting',
6179 'bitmask_value_field' => 42,
6182 'showitem' =>
'aField',
6185 'overrideChildTca' => [
6203 'overrideChildTca' => [
6206 'showitem' =>
'baz',
6207 'bitmask_value_field' => 42,
6210 'showitem' =>
'aField',
6220 $this->assertEquals($expected, $subject->migrate($input));
6234 'foreign_record_defaults' => [
6235 'aField' =>
'doesNotOverrideExistingOverrideChildTcaDefault',
6236 'bField' =>
'aDefault',
6238 'overrideChildTca' => [
6242 'default' =>
'aDefault'
6247 'default' =>
'aDefault'
6263 'overrideChildTca' => [
6267 'default' =>
'aDefault'
6272 'default' =>
'aDefault'
6277 'default' =>
'aDefault'
6288 $this->assertEquals($expected, $subject->migrate($input));
6302 'foreign_selector' =>
'uid_local',
6303 'foreign_selector_fieldTcaOverride' => [
6304 'label' =>
'aDifferentLabel',
6306 'aGivenSetting' =>
'overrideValue',
6307 'aNewSetting' =>
'anotherNewValue',
6308 'anExistingSettingInOverrideChildTca' =>
'doesNotOverrideExistingOverrideChildTcaDefault',
6310 'elementBrowserType' =>
'file',
6311 'elementBrowserAllowed' =>
'jpg,png'
6315 'overrideChildTca' => [
6319 'anExistingSettingInOverrideChildTca' =>
'notOverridenByOldSetting',
6335 'foreign_selector' =>
'uid_local',
6336 'overrideChildTca' => [
6339 'label' =>
'aDifferentLabel',
6341 'anExistingSettingInOverrideChildTca' =>
'notOverridenByOldSetting',
6342 'aGivenSetting' =>
'overrideValue',
6343 'aNewSetting' =>
'anotherNewValue',
6345 'elementBrowserType' =>
'file',
6346 'elementBrowserAllowed' =>
'jpg,png'
6358 $this->assertEquals($expected, $subject->migrate($input));
6370 'columnsOverrides' => [
6374 'foreign_selector' =>
'uid_local',
6375 'foreign_types' => [
6380 'foreign_selector_fieldTcaOverride' => [
6381 'label' =>
'aDifferentLabel',
6383 'aGivenSetting' =>
'overrideValue',
6384 'aNewSetting' =>
'anotherNewValue',
6386 'elementBrowserType' =>
'file',
6387 'elementBrowserAllowed' =>
'jpg,png'
6391 'foreign_record_defaults' => [
6392 'aField' =>
'overriddenValue',
6393 'bField' =>
'overriddenValue',
6406 'columnsOverrides' => [
6410 'foreign_selector' =>
'uid_local',
6411 'overrideChildTca' => [
6419 'label' =>
'aDifferentLabel',
6421 'aGivenSetting' =>
'overrideValue',
6422 'aNewSetting' =>
'anotherNewValue',
6424 'elementBrowserType' =>
'file',
6425 'elementBrowserAllowed' =>
'jpg,png'
6431 'default' =>
'overriddenValue'
6436 'default' =>
'overriddenValue'
6449 $this->assertEquals($expected, $subject->migrate($input));
6463 'foreign_selector' =>
'uid_local',
6464 'overrideChildTca' => [
6475 'elementBrowserType' =>
'file',
6476 'elementBrowserAllowed' =>
'jpg,png'
6487 'columnsOverrides' => [
6490 'foreign_types' => [
6495 'foreign_selector_fieldTcaOverride' => [
6498 'elementBrowserAllowed' =>
'jpg,png'
6515 'foreign_selector' =>
'uid_local',
6516 'overrideChildTca' => [
6527 'elementBrowserType' =>
'file',
6528 'elementBrowserAllowed' =>
'jpg,png'
6539 'columnsOverrides' => [
6542 'overrideChildTca' => [
6552 'elementBrowserAllowed' =>
'jpg,png'
6566 $this->assertEquals($expected, $subject->migrate($input));
6580 'internal_type' =>
'file',
6587 $subject->migrate($input);
6588 $this->assertNotEmpty($subject->getMessages());
6602 'internal_type' =>
'file_reference',
6609 $subject->migrate($input);
6610 $this->assertNotEmpty($subject->getMessages());
6619 'filled columns' => [
6624 'origUid' =>
'aField',
6625 'languageField' =>
'bField',
6626 'transOrigPointerField' =>
'cField',
6627 'translationSource' =>
'dField',
6631 'label' =>
'aField',
6637 'label' =>
'bField',
6643 'label' =>
'cField',
6649 'label' =>
'dField',
6661 'origUid' =>
'aField',
6662 'languageField' =>
'bField',
6663 'transOrigPointerField' =>
'cField',
6664 'translationSource' =>
'dField',
6668 'label' =>
'aField',
6674 'label' =>
'bField',
6680 'label' =>
'cField',
6686 'label' =>
'dField',
6695 'mixed columns' => [
6700 'origUid' =>
'aField',
6701 'languageField' =>
'bField',
6702 'transOrigPointerField' =>
'cField',
6703 'translationSource' =>
'dField',
6707 'label' =>
'aField',
6713 'label' =>
'bField',
6725 'origUid' =>
'aField',
6726 'languageField' =>
'bField',
6727 'transOrigPointerField' =>
'cField',
6728 'translationSource' =>
'dField',
6732 'label' =>
'aField',
6738 'label' =>
'bField',
6745 'type' =>
'passthrough',
6751 'type' =>
'passthrough',
6759 'empty columns' => [
6764 'origUid' =>
'aField',
6765 'languageField' =>
'bField',
6766 'transOrigPointerField' =>
'cField',
6767 'translationSource' =>
'dField',
6776 'origUid' =>
'aField',
6777 'languageField' =>
'bField',
6778 'transOrigPointerField' =>
'cField',
6779 'translationSource' =>
'dField',
6784 'type' =>
'passthrough',
6790 'type' =>
'passthrough',
6796 'type' =>
'passthrough',
6802 'type' =>
'passthrough',
6823 self::assertSame($expectation, $subject->migrate(
$tca));