‪TYPO3CMS  ‪main
TcaMigrationTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PHPUnit\Framework\Attributes\DataProvider;
21 use PHPUnit\Framework\Attributes\Test;
24 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
25 
26 final class ‪TcaMigrationTest extends UnitTestCase
27 {
28  #[Test]
29  public function ‪missingTypeThrowsException(): void
30  {
31  $input = [
32  'aTable' => [
33  'columns' => [
34  'field_a' => [
35  'label' => 'aLabel',
36  'config' => [
37  'type' => 'text',
38  ],
39  ],
40  'field_b' => [
41  'label' => 'bLabel',
42  'config' => [
43  'rows' => 42,
44  'wizards' => [],
45  ],
46  ],
47  ],
48  ],
49  ];
50  $this->expectException(\RuntimeException::class);
51  $this->expectExceptionCode(1482394401);
52  $subject = new ‪TcaMigration();
53  $subject->migrate($input);
54  }
55 
56  #[Test]
58  {
59  $input = $expected = [
60  'aTable' => [
61  'ctrl' => [
62  'aKey' => 'aValue',
63  ],
64  'columns' => [
65  'aField' => [
66  'label' => 'foo',
67  'config' => [
68  'type' => 'aType',
69  'lolli' => 'did this',
70  ],
71  ],
72  ],
73  'types' => [
74  0 => [
75  'showitem' => 'this,should;stay,this,too',
76  ],
77  ],
78  ],
79  ];
80  $subject = new ‪TcaMigration();
81  self::assertEquals($expected, $subject->migrate($input));
82  }
83 
84  #[Test]
85  public function ‪migrateAddsMissingColumnsConfig(): void
86  {
87  $input = [
88  'aTable' => [
89  'columns' => [
90  'aField' => [
91  'exclude' => true,
92  ],
93  'bField' => [
94  ],
95  'cField' => [
96  'config' => 'i am a string but should be an array',
97  ],
98  'dField' => [
99  // This kept as is, 'config' is not added. This is relevant
100  // for "flex" data structure arrays with section containers
101  // that have 'type'=>'array' on this level and an 'el' sub array
102  // with details.
103  'type' => 'array',
104  ],
105  ],
106  ],
107  ];
108  $expected = [
109  'aTable' => [
110  'columns' => [
111  'aField' => [
112  'exclude' => true,
113  'config' => [
114  'type' => 'none',
115  ],
116  ],
117  'bField' => [
118  'config' => [
119  'type' => 'none',
120  ],
121  ],
122  'cField' => [
123  'config' => [
124  'type' => 'none',
125  ],
126  ],
127  'dField' => [
128  'type' => 'array',
129  ],
130  ],
131  ],
132  ];
133  $subject = new ‪TcaMigration();
134  self::assertEquals($expected, $subject->migrate($input));
135  }
136 
137  #[Test]
138  public function ‪ctrlSelIconFieldPathIsRemoved(): void
139  {
140  $input = [
141  'aTable' => [
142  'ctrl' => [
143  'selicon_field' => 'aField',
144  'selicon_field_path' => 'my/folder',
145  ],
146  'columns' => [
147  'aField' => [
148  'config' => [
149  'type' => 'none',
150  ],
151  ],
152  ],
153  ],
154  ];
155  $expected = [
156  'aTable' => [
157  'ctrl' => [
158  'selicon_field' => 'aField',
159  ],
160  'columns' => [
161  'aField' => [
162  'config' => [
163  'type' => 'none',
164  ],
165  ],
166  ],
167  ],
168  ];
169  $subject = new ‪TcaMigration();
170  self::assertEquals($expected, $subject->migrate($input));
171  }
172 
173  #[Test]
174  public function ‪ctrlSetToDefaultOnCopyIsRemoved(): void
175  {
176  $input = [
177  'aTable' => [
178  'ctrl' => [
179  'title' => 'aField',
180  'setToDefaultOnCopy' => 'aField,anotherField',
181  ],
182  'columns' => [
183  'aField' => [
184  'config' => [
185  'type' => 'none',
186  ],
187  ],
188  ],
189  ],
190  ];
191  $expected = [
192  'aTable' => [
193  'ctrl' => [
194  'title' => 'aField',
195  ],
196  'columns' => [
197  'aField' => [
198  'config' => [
199  'type' => 'none',
200  ],
201  ],
202  ],
203  ],
204  ];
205  $subject = new ‪TcaMigration();
206  self::assertEquals($expected, $subject->migrate($input));
207  }
208 
209  public static function ‪ctrlIntegrityColumnsAreAvailableDataProvider(): array
210  {
211  return [
212  'filled columns' => [
213  // tca
214  [
215  'aTable' => [
216  'ctrl' => [
217  'origUid' => 'aField',
218  'languageField' => 'bField',
219  'transOrigPointerField' => 'cField',
220  'translationSource' => 'dField',
221  ],
222  'columns' => [
223  'aField' => [
224  'label' => 'aField',
225  'config' => [
226  'type' => 'none',
227  ],
228  ],
229  'bField' => [
230  'label' => 'bField',
231  'config' => [
232  'type' => 'none',
233  ],
234  ],
235  'cField' => [
236  'label' => 'cField',
237  'config' => [
238  'type' => 'none',
239  ],
240  ],
241  'dField' => [
242  'label' => 'dField',
243  'config' => [
244  'type' => 'none',
245  ],
246  ],
247  ],
248  ],
249  ],
250  // expectation
251  [
252  'aTable' => [
253  'ctrl' => [
254  'origUid' => 'aField',
255  'languageField' => 'bField',
256  'transOrigPointerField' => 'cField',
257  'translationSource' => 'dField',
258  ],
259  'columns' => [
260  'aField' => [
261  'label' => 'aField',
262  'config' => [
263  'type' => 'none',
264  ],
265  ],
266  'bField' => [
267  'label' => 'bField',
268  'config' => [
269  'type' => 'language',
270  ],
271  ],
272  'cField' => [
273  'label' => 'cField',
274  'config' => [
275  'type' => 'none',
276  ],
277  ],
278  'dField' => [
279  'label' => 'dField',
280  'config' => [
281  'type' => 'none',
282  ],
283  ],
284  ],
285  ],
286  ],
287  ],
288  'mixed columns' => [
289  // tca
290  [
291  'aTable' => [
292  'ctrl' => [
293  'origUid' => 'aField',
294  'languageField' => 'bField',
295  'transOrigPointerField' => 'cField',
296  'translationSource' => 'dField',
297  ],
298  'columns' => [
299  'aField' => [
300  'label' => 'aField',
301  'config' => [
302  'type' => 'none',
303  ],
304  ],
305  'bField' => [
306  'label' => 'bField',
307  'config' => [
308  'type' => 'none',
309  ],
310  ],
311  ],
312  ],
313  ],
314  // expectation
315  [
316  'aTable' => [
317  'ctrl' => [
318  'origUid' => 'aField',
319  'languageField' => 'bField',
320  'transOrigPointerField' => 'cField',
321  'translationSource' => 'dField',
322  ],
323  'columns' => [
324  'aField' => [
325  'label' => 'aField',
326  'config' => [
327  'type' => 'none',
328  ],
329  ],
330  'bField' => [
331  'label' => 'bField',
332  'config' => [
333  'type' => 'language',
334  ],
335  ],
336  'cField' => [
337  'config' => [
338  'type' => 'passthrough',
339  'default' => 0,
340  ],
341  ],
342  'dField' => [
343  'config' => [
344  'type' => 'passthrough',
345  'default' => 0,
346  ],
347  ],
348  ],
349  ],
350  ],
351  ],
352  'empty columns' => [
353  // tca
354  [
355  'aTable' => [
356  'ctrl' => [
357  'origUid' => 'aField',
358  'languageField' => 'bField',
359  'transOrigPointerField' => 'cField',
360  'translationSource' => 'dField',
361  ],
362  'columns' => [],
363  ],
364  ],
365  // expectation
366  [
367  'aTable' => [
368  'ctrl' => [
369  'origUid' => 'aField',
370  'languageField' => 'bField',
371  'transOrigPointerField' => 'cField',
372  'translationSource' => 'dField',
373  ],
374  'columns' => [
375  'aField' => [
376  'config' => [
377  'type' => 'passthrough',
378  'default' => 0,
379  ],
380  ],
381  'bField' => [
382  'config' => [
383  'type' => 'language',
384  ],
385  ],
386  'cField' => [
387  'config' => [
388  'type' => 'passthrough',
389  'default' => 0,
390  ],
391  ],
392  'dField' => [
393  'config' => [
394  'type' => 'passthrough',
395  'default' => 0,
396  ],
397  ],
398  ],
399  ],
400  ],
401  ],
402  ];
403  }
404 
405  #[DataProvider('ctrlIntegrityColumnsAreAvailableDataProvider')]
406  #[Test]
407  public function ‪ctrlIntegrityColumnsAreAvailable(array ‪$tca, array $expectation): void
408  {
409  $subject = new ‪TcaMigration();
410  self::assertSame($expectation, $subject->migrate(‪$tca));
411  }
412 
413  #[Test]
415  {
416  $input = [
417  'aTable' => [
418  'columns' => [
419  'aField' => [
420  'config' => [
421  'type' => 'input',
422  'enableMultiSelectFilterTextfield' => false,
423  ],
424  ],
425  'bField' => [
426  'config' => [
427  'type' => 'select',
428  ],
429  ],
430  'cField' => [
431  'config' => [
432  'type' => 'select',
433  'enableMultiSelectFilterTextfield' => true,
434  ],
435  ],
436  ],
437  ],
438  ];
439  $expected = [
440  'aTable' => [
441  'columns' => [
442  'aField' => [
443  'config' => [
444  'type' => 'input',
445  ],
446  ],
447  'bField' => [
448  'config' => [
449  'type' => 'select',
450  ],
451  ],
452  'cField' => [
453  'config' => [
454  'type' => 'select',
455  ],
456  ],
457  ],
458  ],
459  ];
460  $subject = new ‪TcaMigration();
461  self::assertEquals($expected, $subject->migrate($input));
462  }
463 
464  #[Test]
466  {
467  $input = [
468  'aTable' => [
469  'ctrl' => [
470  'transOrigPointerField' => 'l10n_parent',
471  ],
472  'columns' => [
473  'l10n_parent' => [
474  'exclude' => true,
475  'config' => [
476  'type' => 'select',
477  ],
478  ],
479  ],
480  ],
481  'bTable' => [
482  'ctrl' => [
483  'transOrigPointerField' => 'l10n_parent',
484  ],
485  'columns' => [
486  'l10n_parent' => [
487  'config' => [
488  'type' => 'select',
489  ],
490  ],
491  ],
492  ],
493  'cTable' => [
494  'columns' => [
495  'l10n_parent' => [
496  'exclude' => true,
497  'config' => [
498  'type' => 'select',
499  ],
500  ],
501  ],
502  ],
503  ];
504  $expected = [
505  'aTable' => [
506  'ctrl' => [
507  'transOrigPointerField' => 'l10n_parent',
508  ],
509  'columns' => [
510  'l10n_parent' => [
511  'config' => [
512  'type' => 'select',
513  ],
514  ],
515  ],
516  ],
517  'bTable' => [
518  'ctrl' => [
519  'transOrigPointerField' => 'l10n_parent',
520  ],
521  'columns' => [
522  'l10n_parent' => [
523  'config' => [
524  'type' => 'select',
525  ],
526  ],
527  ],
528  ],
529  'cTable' => [
530  'columns' => [
531  'l10n_parent' => [
532  'exclude' => true,
533  'config' => [
534  'type' => 'select',
535  ],
536  ],
537  ],
538  ],
539  ];
540  $subject = new ‪TcaMigration();
541  self::assertEquals($expected, $subject->migrate($input));
542  }
543 
544  #[Test]
546  {
547  $input = [
548  'aTable' => [
549  'interface' => [
550  'showRecordFieldList' => 'title,text,description',
551  ],
552  ],
553  'bTable' => [
554  'interface' => [
555  'showRecordFieldList' => 'title,text,description',
556  'maxDBListItems' => 30,
557  'maxSingleDBListItems' => 50,
558  ],
559  ],
560  ];
561  $expected = [
562  'aTable' => [
563  ],
564  'bTable' => [
565  'interface' => [
566  'maxDBListItems' => 30,
567  'maxSingleDBListItems' => 50,
568  ],
569  ],
570  ];
571  $subject = new ‪TcaMigration();
572  self::assertEquals($expected, $subject->migrate($input));
573  }
574 
575  #[Test]
577  {
578  $input = [
579  'aTable' => [
580  'ctrl' => [
581  'shadowColumnsForMovePlaceholders' => 'aValue',
582  ],
583  ],
584  'bTable' => [
585  'ctrl' => [
586  'label' => 'labelField',
587  'versioningWS' => true,
588  'shadowColumnsForMovePlaceholders' => 'aValue',
589  ],
590  ],
591  ];
592  $expected = [
593  'aTable' => [
594  'ctrl' => [
595  ],
596  ],
597  'bTable' => [
598  'ctrl' => [
599  'label' => 'labelField',
600  'versioningWS' => true,
601  ],
602  ],
603  ];
604  $subject = new ‪TcaMigration();
605  self::assertEquals($expected, $subject->migrate($input));
606  }
607 
608  #[Test]
610  {
611  $input = [
612  'aTable' => [
613  'ctrl' => [
614  'shadowColumnsForNewPlaceholders' => 'aValue',
615  'shadowColumnsForMovePlaceholders' => 'anotherValue',
616  ],
617  ],
618  'bTable' => [
619  'ctrl' => [
620  'label' => 'labelField',
621  'versioningWS' => true,
622  'shadowColumnsForNewPlaceholders' => 'aValue',
623  ],
624  ],
625  ];
626  $expected = [
627  'aTable' => [
628  'ctrl' => [
629  ],
630  ],
631  'bTable' => [
632  'ctrl' => [
633  'label' => 'labelField',
634  'versioningWS' => true,
635  ],
636  ],
637  ];
638  $subject = new ‪TcaMigration();
639  self::assertEquals($expected, $subject->migrate($input));
640  }
641 
642  #[Test]
644  {
645  $input = [
646  'aTable' => [
647  'ctrl' => [
648  'title' => 'aTable',
649  'languageField' => 'aLanguageField',
650  ],
651  'columns' => [
652  'aLanguageField' => [
653  'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
654  'config' => [
655  'type' => 'select',
656  'renderType' => 'selectSingle',
657  'special' => 'languages',
658  'items' => [
659  [
660  'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages',
661  -1,
662  'flags-multiple',
663  ],
664  ],
665  'default' => 0,
666  ],
667  ],
668  ],
669  ],
670  'bTable' => [
671  'ctrl' => [
672  'title' => 'bTable',
673  'languageField' => 'bLanguageField',
674  ],
675  'columns' => [
676  'bLanguageField' => [
677  'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
678  'config' => [
679  'type' => 'select',
680  'renderType' => 'selectSingle',
681  'foreign_table' => 'sys_language',
682  'items' => [
683  ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1],
684  ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0],
685  ],
686  'default' => 0,
687  ],
688  ],
689  ],
690  ],
691  'cTable' => [
692  'ctrl' => [
693  'title' => 'cTable',
694  ],
695  'columns' => [
696  'cLanguageField' => [
697  'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
698  'config' => [
699  'type' => 'select',
700  'renderType' => 'selectSingle',
701  'special' => 'languages',
702  'fieldWizard' => [
703  'selectIcons' => [
704  'disabled' => false,
705  ],
706  ],
707  ],
708  ],
709  ],
710  ],
711  'dTable' => [
712  'ctrl' => [
713  'title' => 'dTable',
714  ],
715  'columns' => [
716  'dLanguageField' => [
717  'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
718  'config' => [
719  'type' => 'select',
720  'renderType' => 'selectSingle',
721  'foreign_table' => 'sys_language',
722  'items' => [
723  ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1],
724  ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0],
725  ],
726  'default' => 0,
727  ],
728  ],
729  ],
730  ],
731  ];
732 
733  $expected = [
734  'aTable' => [
735  'ctrl' => [
736  'title' => 'aTable',
737  'languageField' => 'aLanguageField',
738  ],
739  'columns' => [
740  'aLanguageField' => [
741  'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
742  'config' => [
743  'type' => 'language',
744  ],
745  ],
746  ],
747  ],
748  'bTable' => [
749  'ctrl' => [
750  'title' => 'bTable',
751  'languageField' => 'bLanguageField',
752  ],
753  'columns' => [
754  'bLanguageField' => [
755  'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
756  'config' => [
757  'type' => 'language',
758  ],
759  ],
760  ],
761  ],
762  'cTable' => [
763  'ctrl' => [
764  'title' => 'cTable',
765  ],
766  'columns' => [
767  'cLanguageField' => [
768  'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
769  'config' => [
770  'type' => 'language',
771  ],
772  ],
773  ],
774  ],
775  'dTable' => [
776  'ctrl' => [
777  'title' => 'dTable',
778  ],
779  'columns' => [
780  'dLanguageField' => [
781  'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language',
782  'config' => [
783  'type' => 'select',
784  'renderType' => 'selectSingle',
785  'foreign_table' => 'sys_language',
786  'items' => [
787  ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', 'value' => -1],
788  ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 'value' => 0],
789  ],
790  'default' => 0,
791  ],
792  ],
793  ],
794  ],
795  ];
796 
797  $subject = new ‪TcaMigration();
798  self::assertEquals($expected, $subject->migrate($input));
799  }
800 
801  #[Test]
803  {
804  $input = [
805  'aTable' => [
806  'columns' => [
807  'inlineField' => [
808  'config' => [
809  'type' => 'inline',
810  'appearance' => [
811  'showRemovedLocalizationRecords' => true,
812  ],
813  ],
814  ],
815  ],
816  ],
817  'bTable' => [
818  'columns' => [
819  'inlineField' => [
820  'config' => [
821  'type' => 'inline',
822  'appearance' => [
823  'showRemovedLocalizationRecords' => false,
824  ],
825  ],
826  ],
827  ],
828  ],
829  'cTable' => [
830  'columns' => [
831  'someField' => [
832  'config' => [
833  'type' => 'select',
834  'appearance' => [
835  'showRemovedLocalizationRecords' => true,
836  ],
837  ],
838  ],
839  ],
840  ],
841  ];
842 
843  $expected = [
844  'aTable' => [
845  'columns' => [
846  'inlineField' => [
847  'config' => [
848  'type' => 'inline',
849  'appearance' => [],
850  ],
851  ],
852  ],
853  ],
854  'bTable' => [
855  'columns' => [
856  'inlineField' => [
857  'config' => [
858  'type' => 'inline',
859  'appearance' => [],
860  ],
861  ],
862  ],
863  ],
864  'cTable' => [
865  'columns' => [
866  'someField' => [
867  'config' => [
868  'type' => 'select',
869  'appearance' => [
870  'showRemovedLocalizationRecords' => true,
871  ],
872  ],
873  ],
874  ],
875  ],
876  ];
877 
878  $subject = new ‪TcaMigration();
879  self::assertEquals($expected, $subject->migrate($input));
880  }
881 
882  #[Test]
883  public function ‪fileFolderConfigurationIsMigrated(): void
884  {
885  $input = [
886  'aTable' => [
887  'columns' => [
888  'aField' => [
889  'config' => [
890  'type' => 'select',
891  'renderType' => 'selectSingle',
892  'items' => [['', 0]],
893  'fileFolder' => 'EXT:styleguide/Resources/Public/Icons',
894  'fileFolder_extList' => 'svg',
895  'fileFolder_recursions' => 1,
896  ],
897  ],
898  ],
899  ],
900  'bTable' => [
901  'columns' => [
902  'aField' => [
903  'config' => [
904  'type' => 'select',
905  'renderType' => 'selectSingle',
906  'items' => [['', 0]],
907  'fileFolder' => 'EXT:styleguide/Resources/Public/Icons',
908  ],
909  ],
910  ],
911  ],
912  'cTable' => [
913  'columns' => [
914  'aField' => [
915  'config' => [
916  'type' => 'select',
917  'renderType' => 'selectSingle',
918  'items' => [['', 0]],
919  'fileFolder' => '',
920  'fileFolder_extList' => 'svg',
921  'fileFolder_recursions' => 1,
922  ],
923  ],
924  ],
925  ],
926  'dTable' => [
927  'columns' => [
928  'aField' => [
929  'config' => [
930  'type' => 'input',
931  'fileFolder' => 'EXT:styleguide/Resources/Public/Icons',
932  'fileFolder_extList' => 'svg',
933  'fileFolder_recursions' => 1,
934  ],
935  ],
936  ],
937  ],
938  'eTable' => [
939  'columns' => [
940  'aField' => [
941  'config' => [
942  'type' => 'select',
943  'renderType' => 'selectSingle',
944  'items' => [['', 0]],
945  'fileFolder_extList' => 'svg',
946  'fileFolder_recursions' => 1,
947  ],
948  ],
949  ],
950  ],
951  ];
952 
953  $expected = [
954  'aTable' => [
955  'columns' => [
956  'aField' => [
957  'config' => [
958  'type' => 'select',
959  'renderType' => 'selectSingle',
960  'items' => [['label' => '', 'value' => 0]],
961  'fileFolderConfig' => [
962  'folder' => 'EXT:styleguide/Resources/Public/Icons',
963  'allowedExtensions' => 'svg',
964  'depth' => 1,
965  ],
966  ],
967  ],
968  ],
969  ],
970  'bTable' => [
971  'columns' => [
972  'aField' => [
973  'config' => [
974  'type' => 'select',
975  'renderType' => 'selectSingle',
976  'items' => [['label' => '', 'value' => 0]],
977  'fileFolderConfig' => [
978  'folder' => 'EXT:styleguide/Resources/Public/Icons',
979  ],
980  ],
981  ],
982  ],
983  ],
984  'cTable' => [
985  'columns' => [
986  'aField' => [
987  'config' => [
988  'type' => 'select',
989  'renderType' => 'selectSingle',
990  'items' => [['label' => '', 'value' => 0]],
991  'fileFolderConfig' => [
992  'folder' => '',
993  'allowedExtensions' => 'svg',
994  'depth' => 1,
995  ],
996  ],
997  ],
998  ],
999  ],
1000  'dTable' => [
1001  'columns' => [
1002  'aField' => [
1003  'config' => [
1004  'type' => 'input',
1005  'fileFolder' => 'EXT:styleguide/Resources/Public/Icons',
1006  'fileFolder_extList' => 'svg',
1007  'fileFolder_recursions' => 1,
1008  ],
1009  ],
1010  ],
1011  ],
1012  'eTable' => [
1013  'columns' => [
1014  'aField' => [
1015  'config' => [
1016  'type' => 'select',
1017  'renderType' => 'selectSingle',
1018  'items' => [['label' => '', 'value' => 0]],
1019  'fileFolder_extList' => 'svg',
1020  'fileFolder_recursions' => 1,
1021  ],
1022  ],
1023  ],
1024  ],
1025  ];
1026 
1027  $subject = new ‪TcaMigration();
1028  self::assertEquals($expected, $subject->migrate($input));
1029  }
1030 
1031  #[Test]
1032  public function ‪levelLinksPositionIsMigrated(): void
1033  {
1034  $input = [
1035  'aTable' => [
1036  'columns' => [
1037  'aField' => [
1038  'config' => [
1039  'type' => 'inline',
1040  'appearance' => [
1041  'levelLinksPosition' => 'none',
1042  ],
1043  ],
1044  ],
1045  ],
1046  ],
1047  'bTable' => [
1048  'columns' => [
1049  'aField' => [
1050  'config' => [
1051  'type' => 'inline',
1052  'appearance' => [
1053  'levelLinksPosition' => 'invalid',
1054  ],
1055  ],
1056  ],
1057  ],
1058  ],
1059  'cTable' => [
1060  'columns' => [
1061  'aField' => [
1062  'config' => [
1063  'type' => 'inline',
1064  'appearance' => [
1065  'levelLinksPosition' => 'both',
1066  ],
1067  ],
1068  ],
1069  ],
1070  ],
1071  'dTable' => [
1072  'columns' => [
1073  'aField' => [
1074  'config' => [
1075  'type' => 'select',
1076  'appearance' => [
1077  'levelLinksPosition' => 'none',
1078  ],
1079  ],
1080  ],
1081  ],
1082  ],
1083  ];
1084 
1085  $expected = [
1086  'aTable' => [
1087  'columns' => [
1088  'aField' => [
1089  'config' => [
1090  'type' => 'inline',
1091  'appearance' => [
1092  'showAllLocalizationLink' => false,
1093  'showSynchronizationLink' => false,
1094  'showNewRecordLink' => false,
1095  ],
1096  ],
1097  ],
1098  ],
1099  ],
1100  'bTable' => [
1101  'columns' => [
1102  'aField' => [
1103  'config' => [
1104  'type' => 'inline',
1105  'appearance' => [
1106  'levelLinksPosition' => 'invalid',
1107  ],
1108  ],
1109  ],
1110  ],
1111  ],
1112  'cTable' => [
1113  'columns' => [
1114  'aField' => [
1115  'config' => [
1116  'type' => 'inline',
1117  'appearance' => [
1118  'levelLinksPosition' => 'both',
1119  ],
1120  ],
1121  ],
1122  ],
1123  ],
1124  'dTable' => [
1125  'columns' => [
1126  'aField' => [
1127  'config' => [
1128  'type' => 'select',
1129  'appearance' => [
1130  'levelLinksPosition' => 'none',
1131  ],
1132  ],
1133  ],
1134  ],
1135  ],
1136  ];
1137 
1138  $subject = new ‪TcaMigration();
1139  self::assertEquals($expected, $subject->migrate($input));
1140  }
1141 
1142  #[Test]
1144  {
1145  $input = [
1146  'aTable' => [
1147  'columns' => [
1148  'aField' => [
1149  'config' => [
1150  'type' => 'select',
1151  'renderType' => 'selectTree',
1152  'treeConfig' => [
1153  'rootUid' => 42,
1154  ],
1155  ],
1156  ],
1157  ],
1158  ],
1159  'bTable' => [
1160  'columns' => [
1161  'aField' => [
1162  'config' => [
1163  'type' => 'category',
1164  'treeConfig' => [
1165  'rootUid' => 43,
1166  ],
1167  ],
1168  ],
1169  ],
1170  ],
1171  'cTable' => [
1172  'columns' => [
1173  'aField' => [
1174  'config' => [
1175  'type' => 'select',
1176  'renderType' => 'selectTree',
1177  ],
1178  ],
1179  ],
1180  ],
1181  'dTable' => [
1182  'columns' => [
1183  'aField' => [
1184  'config' => [
1185  // This config makes no sense, however we will not touch it
1186  'type' => 'input',
1187  'treeConfig' => [
1188  'rootUid' => 43,
1189  ],
1190  ],
1191  ],
1192  ],
1193  ],
1194  ];
1195 
1196  $expected = [
1197  'aTable' => [
1198  'columns' => [
1199  'aField' => [
1200  'config' => [
1201  'type' => 'select',
1202  'renderType' => 'selectTree',
1203  'treeConfig' => [
1204  'startingPoints' => '42',
1205  ],
1206  ],
1207  ],
1208  ],
1209  ],
1210  'bTable' => [
1211  'columns' => [
1212  'aField' => [
1213  'config' => [
1214  'type' => 'category',
1215  'treeConfig' => [
1216  'startingPoints' => '43',
1217  ],
1218  ],
1219  ],
1220  ],
1221  ],
1222  'cTable' => [
1223  'columns' => [
1224  'aField' => [
1225  'config' => [
1226  'type' => 'select',
1227  'renderType' => 'selectTree',
1228  ],
1229  ],
1230  ],
1231  ],
1232  'dTable' => [
1233  'columns' => [
1234  'aField' => [
1235  'config' => [
1236  'type' => 'input',
1237  'treeConfig' => [
1238  'rootUid' => 43,
1239  ],
1240  ],
1241  ],
1242  ],
1243  ],
1244  ];
1245 
1246  $subject = new ‪TcaMigration();
1247  self::assertEquals($expected, $subject->migrate($input));
1248  }
1249 
1250  public static function ‪internalTypeFolderMigratedToTypeDataProvider(): iterable
1251  {
1252  yield 'internal_type=folder migrated to type=folder' => [
1253  'input' => [
1254  'aTable' => [
1255  'columns' => [
1256  'aColumn' => [
1257  'config' => [
1258  'type' => 'group',
1259  'internal_type' => 'folder',
1260  'maxitems' => 2,
1261  ],
1262  ],
1263  'bColumn' => [
1264  'config' => [
1265  'type' => 'group',
1266  'internal_type' => 'db',
1267  'minitems' => 2,
1268  ],
1269  ],
1270  ],
1271  ],
1272  ],
1273  'expected' => [
1274  'aTable' => [
1275  'columns' => [
1276  'aColumn' => [
1277  'config' => [
1278  'type' => 'folder',
1279  'maxitems' => 2,
1280  ],
1281  ],
1282  'bColumn' => [
1283  'config' => [
1284  'type' => 'group',
1285  'minitems' => 2,
1286  ],
1287  ],
1288  ],
1289  ],
1290  ],
1291  ];
1292  }
1293 
1294  #[DataProvider('internalTypeFolderMigratedToTypeDataProvider')]
1295  #[Test]
1296  public function ‪internalTypeFolderMigratedToType(array $input, array $expected): void
1297  {
1298  $subject = new ‪TcaMigration();
1299  self::assertSame($expected, $subject->migrate($input));
1300  }
1301 
1302  public static function ‪requiredFlagIsMigratedDataProvider(): iterable
1303  {
1304  yield 'field contains eval=required' => [
1305  'tca' => [
1306  'aTable' => [
1307  'columns' => [
1308  'aColumn' => [
1309  'config' => [
1310  'type' => 'input',
1311  'eval' => 'required',
1312  ],
1313  ],
1314  ],
1315  ],
1316  ],
1317  'expected' => [
1318  'aTable' => [
1319  'columns' => [
1320  'aColumn' => [
1321  'config' => [
1322  'type' => 'input',
1323  'required' => true,
1324  ],
1325  ],
1326  ],
1327  ],
1328  ],
1329  ];
1330 
1331  yield 'field contains eval=trim,required' => [
1332  'tca' => [
1333  'aTable' => [
1334  'columns' => [
1335  'aColumn' => [
1336  'config' => [
1337  'type' => 'input',
1338  'eval' => 'trim,required',
1339  ],
1340  ],
1341  ],
1342  ],
1343  ],
1344  'expected' => [
1345  'aTable' => [
1346  'columns' => [
1347  'aColumn' => [
1348  'config' => [
1349  'type' => 'input',
1350  'required' => true,
1351  'eval' => 'trim',
1352  ],
1353  ],
1354  ],
1355  ],
1356  ],
1357  ];
1358 
1359  yield 'field does not contain eval with required' => [
1360  'tca' => [
1361  'aTable' => [
1362  'columns' => [
1363  'aColumn' => [
1364  'config' => [
1365  'type' => 'input',
1366  'eval' => 'trim',
1367  ],
1368  ],
1369  ],
1370  ],
1371  ],
1372  'expected' => [
1373  'aTable' => [
1374  'columns' => [
1375  'aColumn' => [
1376  'config' => [
1377  'type' => 'input',
1378  'eval' => 'trim',
1379  ],
1380  ],
1381  ],
1382  ],
1383  ],
1384  ];
1385 
1386  yield 'field does not contain eval' => [
1387  'tca' => [
1388  'aTable' => [
1389  'columns' => [
1390  'aColumn' => [
1391  'config' => [
1392  'type' => 'input',
1393  ],
1394  ],
1395  ],
1396  ],
1397  ],
1398  'expected' => [
1399  'aTable' => [
1400  'columns' => [
1401  'aColumn' => [
1402  'config' => [
1403  'type' => 'input',
1404  ],
1405  ],
1406  ],
1407  ],
1408  ],
1409  ];
1410  }
1411 
1412  #[DataProvider('requiredFlagIsMigratedDataProvider')]
1413  #[Test]
1414  public function ‪requiredFlagIsMigrated(array ‪$tca, array $expected): void
1415  {
1416  $subject = new ‪TcaMigration();
1417  self::assertEquals($expected, $subject->migrate(‪$tca));
1418  }
1419 
1420  public static function ‪evalNullMigratedToNullableOptionDataProvider(): iterable
1421  {
1422  yield 'field contains eval=null' => [
1423  'tca' => [
1424  'aTable' => [
1425  'columns' => [
1426  'aColumn' => [
1427  'config' => [
1428  'type' => 'input',
1429  'eval' => 'null',
1430  ],
1431  ],
1432  ],
1433  ],
1434  ],
1435  'expected' => [
1436  'aTable' => [
1437  'columns' => [
1438  'aColumn' => [
1439  'config' => [
1440  'type' => 'input',
1441  'nullable' => true,
1442  ],
1443  ],
1444  ],
1445  ],
1446  ],
1447  ];
1448 
1449  yield 'field contains eval=trim,null' => [
1450  'tca' => [
1451  'aTable' => [
1452  'columns' => [
1453  'aColumn' => [
1454  'config' => [
1455  'type' => 'input',
1456  'eval' => 'trim,null',
1457  ],
1458  ],
1459  ],
1460  ],
1461  ],
1462  'expected' => [
1463  'aTable' => [
1464  'columns' => [
1465  'aColumn' => [
1466  'config' => [
1467  'type' => 'input',
1468  'eval' => 'trim',
1469  'nullable' => true,
1470  ],
1471  ],
1472  ],
1473  ],
1474  ],
1475  ];
1476 
1477  yield 'field does not contain eval with null' => [
1478  'tca' => [
1479  'aTable' => [
1480  'columns' => [
1481  'aColumn' => [
1482  'config' => [
1483  'type' => 'input',
1484  'eval' => 'trim',
1485  ],
1486  ],
1487  ],
1488  ],
1489  ],
1490  'expected' => [
1491  'aTable' => [
1492  'columns' => [
1493  'aColumn' => [
1494  'config' => [
1495  'type' => 'input',
1496  'eval' => 'trim',
1497  ],
1498  ],
1499  ],
1500  ],
1501  ],
1502  ];
1503 
1504  yield 'field does not contain eval' => [
1505  'tca' => [
1506  'aTable' => [
1507  'columns' => [
1508  'aColumn' => [
1509  'config' => [
1510  'type' => 'input',
1511  ],
1512  ],
1513  ],
1514  ],
1515  ],
1516  'expected' => [
1517  'aTable' => [
1518  'columns' => [
1519  'aColumn' => [
1520  'config' => [
1521  'type' => 'input',
1522  ],
1523  ],
1524  ],
1525  ],
1526  ],
1527  ];
1528  }
1529 
1534  #[DataProvider('evalNullMigratedToNullableOptionDataProvider')]
1535  #[Test]
1536  public function ‪evalNullMigratedToNullableOption(array ‪$tca, array $expected): void
1537  {
1538  $subject = new ‪TcaMigration();
1539  self::assertSame($expected, $subject->migrate(‪$tca));
1540  }
1541 
1542  public static function ‪evalEmailMigratedToTypeDataProvider(): iterable
1543  {
1544  yield 'eval=email migrated to type=email' => [
1545  'input' => [
1546  'aTable' => [
1547  'columns' => [
1548  'aColumn' => [
1549  'config' => [
1550  'type' => 'input',
1551  'eval' => 'email,trim,unique,uniqueInPid',
1552  'required' => true,
1553  'nullable' => true,
1554  ],
1555  ],
1556  'bColumn' => [
1557  'config' => [
1558  'type' => 'input',
1559  'eval' => 'email,trim',
1560  'required' => true,
1561  ],
1562  ],
1563  'differentColumn' => [
1564  'config' => [
1565  'type' => 'input',
1566  'eval' => 'trim,unique',
1567  ],
1568  ],
1569  'columnWithOutdatedConfiguration' => [
1570  'config' => [
1571  'type' => 'input',
1572  'eval' => 'email',
1573  'max' => 255,
1574  ],
1575  ],
1576  'wrongTypeColumn' => [
1577  'config' => [
1578  'type' => 'text',
1579  'eval' => 'email,trim,unique',
1580  ],
1581  ],
1582  'alreadyMigratedColumn' => [
1583  'config' => [
1584  'type' => 'email',
1585  ],
1586  ],
1587  ],
1588  ],
1589  ],
1590  'expected' => [
1591  'aTable' => [
1592  'columns' => [
1593  'aColumn' => [
1594  'config' => [
1595  'type' => 'email',
1596  'eval' => 'unique,uniqueInPid',
1597  'required' => true,
1598  'nullable' => true,
1599  ],
1600  ],
1601  'bColumn' => [
1602  'config' => [
1603  'type' => 'email',
1604  'required' => true,
1605  ],
1606  ],
1607  'differentColumn' => [
1608  'config' => [
1609  'type' => 'input',
1610  'eval' => 'trim,unique',
1611  ],
1612  ],
1613  'columnWithOutdatedConfiguration' => [
1614  'config' => [
1615  'type' => 'email',
1616  ],
1617  ],
1618  'wrongTypeColumn' => [
1619  'config' => [
1620  'type' => 'text',
1621  'eval' => 'email,trim,unique',
1622  ],
1623  ],
1624  'alreadyMigratedColumn' => [
1625  'config' => [
1626  'type' => 'email',
1627  ],
1628  ],
1629  ],
1630  ],
1631  ],
1632  ];
1633  }
1634 
1635  #[DataProvider('evalEmailMigratedToTypeDataProvider')]
1636  #[Test]
1637  public function ‪evalEmailMigratedToType(array $input, array $expected): void
1638  {
1639  $subject = new ‪TcaMigration();
1640  self::assertSame($expected, $subject->migrate($input));
1641  }
1642 
1643  public static function ‪typeNoneColsMigratedToSizeDataProvider(): iterable
1644  {
1645  yield 'type none cols migrated to size' => [
1646  'tca' => [
1647  'aTable' => [
1648  'columns' => [
1649  'aColumn' => [
1650  'config' => [
1651  'type' => 'none',
1652  'format' => 'int',
1653  'cols' => 20,
1654  ],
1655  ],
1656  ],
1657  ],
1658  ],
1659  'expected' => [
1660  'aTable' => [
1661  'columns' => [
1662  'aColumn' => [
1663  'config' => [
1664  'type' => 'none',
1665  'format' => 'int',
1666  'size' => 20,
1667  ],
1668  ],
1669  ],
1670  ],
1671  ],
1672  ];
1673 
1674  yield 'cols has priority over size and overrides it, if both are set' => [
1675  'tca' => [
1676  'aTable' => [
1677  'columns' => [
1678  'aColumn' => [
1679  'config' => [
1680  'type' => 'none',
1681  'cols' => 20,
1682  'size' => 30,
1683  ],
1684  ],
1685  ],
1686  ],
1687  ],
1688  'expected' => [
1689  'aTable' => [
1690  'columns' => [
1691  'aColumn' => [
1692  'config' => [
1693  'type' => 'none',
1694  'size' => 20,
1695  ],
1696  ],
1697  ],
1698  ],
1699  ],
1700  ];
1701  }
1702 
1703  #[DataProvider('typeNoneColsMigratedToSizeDataProvider')]
1704  #[Test]
1705  public function ‪typeNoneColsMigratedToSize(array ‪$tca, array $expected): void
1706  {
1707  $subject = new ‪TcaMigration();
1708  self::assertSame($expected, $subject->migrate(‪$tca));
1709  }
1710 
1711  public static function ‪renderTypeInputLinkMigratedToTypeLinkDataProvider(): iterable
1712  {
1713  yield 'Full example of renderType=inputLink migrated to type=link' => [
1714  'input' => [
1715  'aTable' => [
1716  'columns' => [
1717  'aColumn' => [
1718  'config' => [
1719  'type' => 'input',
1720  'renderType' => 'inputLink',
1721  'required' => true,
1722  'nullable' => true,
1723  'size' => 21,
1724  'max' => 1234,
1725  'eval' => 'trim',
1726  'fieldControl' => [
1727  'linkPopup' => [
1728  'disabled' => true,
1729  'options' => [
1730  'title' => 'Browser label',
1731  'allowedExtensions' => 'jpg,png',
1732  'blindLinkFields' => 'class,target,title',
1733  'blindLinkOptions' => 'mail,folder,file,telephone',
1734  ],
1735  ],
1736  ],
1737  'softref' => 'typolink',
1738  ],
1739  ],
1740  ],
1741  ],
1742  ],
1743  'expected' => [
1744  'aTable' => [
1745  'columns' => [
1746  'aColumn' => [
1747  'config' => [
1748  'type' => 'link',
1749  'required' => true,
1750  'nullable' => true,
1751  'size' => 21,
1752  'allowedTypes' => ['page', 'url', 'record'], // Ensures mail=>email str_replace works
1753  'appearance' => [
1754  'enableBrowser' => false,
1755  'browserTitle' => 'Browser label',
1756  'allowedOptions' => ['params', 'rel'],
1757  'allowedFileExtensions' => ['jpg', 'png'],
1758  ],
1759  ],
1760  ],
1761  ],
1762  ],
1763  ],
1764  ];
1765  yield 'Migrate type and remove eval' => [
1766  'input' => [
1767  'aTable' => [
1768  'columns' => [
1769  'aColumn' => [
1770  'config' => [
1771  'type' => 'input',
1772  'renderType' => 'inputLink',
1773  'eval' => 'trim',
1774  ],
1775  ],
1776  ],
1777  ],
1778  ],
1779  'expected' => [
1780  'aTable' => [
1781  'columns' => [
1782  'aColumn' => [
1783  'config' => [
1784  'type' => 'link',
1785  ],
1786  ],
1787  ],
1788  ],
1789  ],
1790  ];
1791  yield 'full blind options' => [
1792  'input' => [
1793  'aTable' => [
1794  'columns' => [
1795  'aColumn' => [
1796  'config' => [
1797  'type' => 'input',
1798  'renderType' => 'inputLink',
1799  'fieldControl' => [
1800  'linkPopup' => [
1801  'options' => [
1802  'blindLinkOptions' => 'page,file,folder,url,mail,record,telephone',
1803  'blindLinkFields' => 'class,target,title,params,rel',
1804  ],
1805  ],
1806  ],
1807  ],
1808  ],
1809  ],
1810  ],
1811  ],
1812  'expected' => [
1813  'aTable' => [
1814  'columns' => [
1815  'aColumn' => [
1816  'config' => [
1817  'type' => 'link',
1818  'allowedTypes' => [], // This is migrated correctly but will lead to an exception in the element
1819  'appearance' => [
1820  'allowedOptions' => [],
1821  ],
1822  ],
1823  ],
1824  ],
1825  ],
1826  ],
1827  ];
1828  yield 'empty blind options' => [
1829  'input' => [
1830  'aTable' => [
1831  'columns' => [
1832  'aColumn' => [
1833  'config' => [
1834  'type' => 'input',
1835  'renderType' => 'inputLink',
1836  'fieldControl' => [
1837  'linkPopup' => [
1838  'disabled' => false,
1839  'options' => [
1840  'title' => '',
1841  'blindLinkOptions' => '',
1842  'blindLinkFields' => '',
1843  'allowedExtensions' => '',
1844  ],
1845  ],
1846  ],
1847  ],
1848  ],
1849  ],
1850  ],
1851  ],
1852  'expected' => [
1853  'aTable' => [
1854  'columns' => [
1855  'aColumn' => [
1856  'config' => [
1857  'type' => 'link',
1858  ],
1859  ],
1860  ],
1861  ],
1862  ],
1863  ];
1864  yield 'Non empty FieldControl is kept' => [
1865  'input' => [
1866  'aTable' => [
1867  'columns' => [
1868  'aColumn' => [
1869  'config' => [
1870  'type' => 'input',
1871  'renderType' => 'inputLink',
1872  'eval' => 'trim',
1873  'fieldControl' => [
1874  'linkPopup' => [
1875  'disabled' => true,
1876  ],
1877  'editPopup' => [
1878  'disabled' => false,
1879  ],
1880  ],
1881  ],
1882  ],
1883  ],
1884  ],
1885  ],
1886  'expected' => [
1887  'aTable' => [
1888  'columns' => [
1889  'aColumn' => [
1890  'config' => [
1891  'type' => 'link',
1892  'fieldControl' => [
1893  'editPopup' => [
1894  'disabled' => false,
1895  ],
1896  ],
1897  'appearance' => [
1898  'enableBrowser' => false,
1899  ],
1900  ],
1901  ],
1902  ],
1903  ],
1904  ],
1905  ];
1906  yield 'Ensure "email" is used as term' => [
1907  'input' => [
1908  'aTable' => [
1909  'columns' => [
1910  'aColumn' => [
1911  'config' => [
1912  'type' => 'input',
1913  'renderType' => 'inputLink',
1914  'fieldControl' => [
1915  'linkPopup' => [
1916  'options' => [
1917  'blindLinkOptions' => 'page,file,folder,url,telephone',
1918  ],
1919  ],
1920  ],
1921  ],
1922  ],
1923  ],
1924  ],
1925  ],
1926  'expected' => [
1927  'aTable' => [
1928  'columns' => [
1929  'aColumn' => [
1930  'config' => [
1931  'type' => 'link',
1932  'allowedTypes' => ['email', 'record'],
1933  ],
1934  ],
1935  ],
1936  ],
1937  ],
1938  ];
1939  }
1940 
1941  #[DataProvider('renderTypeInputLinkMigratedToTypeLinkDataProvider')]
1942  #[Test]
1943  public function ‪renderTypeInputLinkMigratedToTypeLink(array $input, array $expected): void
1944  {
1945  $subject = new ‪TcaMigration();
1946  self::assertSame($expected, $subject->migrate($input));
1947  }
1948 
1950  {
1951  yield 'eval=password and eval=saltedPassword migrated to type=password' => [
1952  'input' => [
1953  'aTable' => [
1954  'columns' => [
1955  'aColumn' => [
1956  'config' => [
1957  'type' => 'input',
1958  'eval' => 'trim,password,saltedPassword',
1959  'required' => true,
1960  ],
1961  ],
1962  'aColumnWithPassword' => [
1963  'config' => [
1964  'type' => 'input',
1965  'eval' => 'trim,password',
1966  'required' => true,
1967  ],
1968  ],
1969  'aColumnWithSaltedpassword' => [
1970  'config' => [
1971  'type' => 'input',
1972  'eval' => 'trim,saltedPassword',
1973  'required' => true,
1974  ],
1975  ],
1976  'fullMigration' => [
1977  'config' => [
1978  'type' => 'input',
1979  'eval' => 'trim,password,saltedPassword,int',
1980  'required' => true,
1981  'nullable' => true,
1982  'max' => 1234,
1983  'search' => [
1984  'andWhere' => '{#CType}=\'text\' OR {#CType}=\'textpic\' OR {#CType}=\'textmedia\'',
1985  ],
1986  ],
1987  ],
1988  'differentColumn' => [
1989  'config' => [
1990  'type' => 'input',
1991  'eval' => 'trim,unique',
1992  ],
1993  ],
1994  'wrongTypeColumn' => [
1995  'config' => [
1996  'type' => 'text',
1997  'eval' => 'trim,password,saltedPassword',
1998  ],
1999  ],
2000  'alreadyMigratedColumn' => [
2001  'config' => [
2002  'type' => 'password',
2003  ],
2004  ],
2005  ],
2006  ],
2007  ],
2008  'expected' => [
2009  'aTable' => [
2010  'columns' => [
2011  'aColumn' => [
2012  'config' => [
2013  'type' => 'password',
2014  'required' => true,
2015  ],
2016  ],
2017  'aColumnWithPassword' => [
2018  'config' => [
2019  'type' => 'password',
2020  'required' => true,
2021  'hashed' => false,
2022  ],
2023  ],
2024  'aColumnWithSaltedpassword' => [
2025  'config' => [
2026  'type' => 'password',
2027  'required' => true,
2028  ],
2029  ],
2030  'fullMigration' => [
2031  'config' => [
2032  'type' => 'password',
2033  'required' => true,
2034  'nullable' => true,
2035  ],
2036  ],
2037  'differentColumn' => [
2038  'config' => [
2039  'type' => 'input',
2040  'eval' => 'trim,unique',
2041  ],
2042  ],
2043  'wrongTypeColumn' => [
2044  'config' => [
2045  'type' => 'text',
2046  'eval' => 'trim,password,saltedPassword',
2047  ],
2048  ],
2049  'alreadyMigratedColumn' => [
2050  'config' => [
2051  'type' => 'password',
2052  ],
2053  ],
2054  ],
2055  ],
2056  ],
2057  ];
2058  }
2059 
2060  #[DataProvider('evalPasswordSaltedPasswordMigratedToTypePasswordDataProvider')]
2061  #[Test]
2062  public function ‪evalPasswordSaltedPasswordMigratedToTypePassword(array $input, array $expected): void
2063  {
2064  $subject = new ‪TcaMigration();
2065  self::assertSame($expected, $subject->migrate($input));
2066  }
2067 
2069  {
2070  yield 'Full example of renderType=inputDateTime migrated to type=datetime' => [
2071  'input' => [
2072  'aTable' => [
2073  'columns' => [
2074  'aColumn' => [
2075  'config' => [
2076  'type' => 'input',
2077  'renderType' => 'inputDateTime',
2078  'format' => 'date',
2079  'required' => true,
2080  'nullable' => true,
2081  'readOnly' => true,
2082  'size' => 20,
2083  'max' => 1234,
2084  'eval' => 'trim,time,int',
2085  ],
2086  ],
2087  ],
2088  ],
2089  ],
2090  'expected' => [
2091  'aTable' => [
2092  'columns' => [
2093  'aColumn' => [
2094  'config' => [
2095  'type' => 'datetime',
2096  'required' => true,
2097  'nullable' => true,
2098  'readOnly' => true,
2099  'size' => 20,
2100  'format' => 'time',
2101  ],
2102  ],
2103  ],
2104  ],
2105  ],
2106  ];
2107  yield 'format, renderType and eval are unset' => [
2108  'input' => [
2109  'aTable' => [
2110  'columns' => [
2111  'aColumn' => [
2112  'config' => [
2113  'type' => 'input',
2114  'format' => 'date',
2115  'renderType' => 'inputDateTime',
2116  'eval' => 'trim,datetime,int',
2117  ],
2118  ],
2119  ],
2120  ],
2121  ],
2122  'expected' => [
2123  'aTable' => [
2124  'columns' => [
2125  'aColumn' => [
2126  'config' => [
2127  'type' => 'datetime',
2128  ],
2129  ],
2130  ],
2131  ],
2132  ],
2133  ];
2134  yield 'eval=datetime is kept when type=input or renderType=inputDateTime is missing' => [
2135  'input' => [
2136  'aTable' => [
2137  'columns' => [
2138  'aColumn' => [
2139  'config' => [
2140  'type' => 'input',
2141  'eval' => 'datetime',
2142  ],
2143  ],
2144  ],
2145  ],
2146  'bTable' => [
2147  'columns' => [
2148  'aColumn' => [
2149  'config' => [
2150  'type' => 'text',
2151  'renderType' => 'inputDateTime',
2152  'eval' => 'datetime',
2153  ],
2154  ],
2155  ],
2156  ],
2157  ],
2158  'expected' => [
2159  'aTable' => [
2160  'columns' => [
2161  'aColumn' => [
2162  'config' => [
2163  'type' => 'input',
2164  'eval' => 'datetime',
2165  ],
2166  ],
2167  ],
2168  ],
2169  'bTable' => [
2170  'columns' => [
2171  'aColumn' => [
2172  'config' => [
2173  'type' => 'text',
2174  'renderType' => 'inputDateTime',
2175  'eval' => 'datetime',
2176  ],
2177  ],
2178  ],
2179  ],
2180  ],
2181  ];
2182  yield 'Unset default for native type fields, if it\'s the types empty value' => [
2183  'input' => [
2184  'aTable' => [
2185  'columns' => [
2186  'aColumn' => [
2187  'config' => [
2188  'type' => 'input',
2189  'renderType' => 'inputDateTime',
2190  'dbType' => 'date',
2191  'eval' => 'date',
2192  'default' => '0000-00-00',
2193  ],
2194  ],
2195  'bColumn' => [
2196  'config' => [
2197  'type' => 'input',
2198  'renderType' => 'inputDateTime',
2199  'dbType' => 'datetime',
2200  'eval' => 'datetime',
2201  'default' => '0000-00-00 00:00:00',
2202  ],
2203  ],
2204  'cColumn' => [
2205  'config' => [
2206  'type' => 'input',
2207  'renderType' => 'inputDateTime',
2208  'dbType' => 'time',
2209  'eval' => 'time',
2210  'default' => '00:00:00',
2211  ],
2212  ],
2213  'dColumn' => [
2214  'config' => [
2215  'type' => 'input',
2216  'renderType' => 'inputDateTime',
2217  'dbType' => 'time',
2218  'eval' => 'time',
2219  'default' => '20:20:20',
2220  ],
2221  ],
2222  ],
2223  ],
2224  ],
2225  'expected' => [
2226  'aTable' => [
2227  'columns' => [
2228  'aColumn' => [
2229  'config' => [
2230  'type' => 'datetime',
2231  'dbType' => 'date',
2232  'format' => 'date',
2233  ],
2234  ],
2235  'bColumn' => [
2236  'config' => [
2237  'type' => 'datetime',
2238  'dbType' => 'datetime',
2239  ],
2240  ],
2241  'cColumn' => [
2242  'config' => [
2243  'type' => 'datetime',
2244  'dbType' => 'time',
2245  'format' => 'time',
2246  ],
2247  ],
2248  'dColumn' => [
2249  'config' => [
2250  'type' => 'datetime',
2251  'dbType' => 'time',
2252  'default' => '20:20:20',
2253  'format' => 'time',
2254  ],
2255  ],
2256  ],
2257  ],
2258  ],
2259  ];
2260  yield 'Update default value for datetime if it\'s no int value and no native type is used' => [
2261  'input' => [
2262  'aTable' => [
2263  'columns' => [
2264  'aColumn' => [
2265  'config' => [
2266  'type' => 'input',
2267  'renderType' => 'inputDateTime',
2268  'eval' => 'datetime',
2269  'default' => '0',
2270  ],
2271  ],
2272  'bColumn' => [
2273  'config' => [
2274  'type' => 'input',
2275  'renderType' => 'inputDateTime',
2276  'eval' => 'datetime',
2277  'default' => '',
2278  ],
2279  ],
2280  'cColumn' => [
2281  'config' => [
2282  'type' => 'input',
2283  'renderType' => 'inputDateTime',
2284  'eval' => 'datetime',
2285  'default' => '16362836',
2286  ],
2287  ],
2288  'dColumn' => [
2289  'config' => [
2290  'type' => 'input',
2291  'renderType' => 'inputDateTime',
2292  'eval' => 'datetime',
2293  'default' => 'invalid',
2294  ],
2295  ],
2296  'eColumn' => [
2297  'config' => [
2298  'type' => 'input',
2299  'renderType' => 'inputDateTime',
2300  'default' => time(),
2301  ],
2302  ],
2303  ],
2304  ],
2305  ],
2306  'expected' => [
2307  'aTable' => [
2308  'columns' => [
2309  'aColumn' => [
2310  'config' => [
2311  'type' => 'datetime',
2312  'default' => 0,
2313  ],
2314  ],
2315  'bColumn' => [
2316  'config' => [
2317  'type' => 'datetime',
2318  'default' => 0,
2319  ],
2320  ],
2321  'cColumn' => [
2322  'config' => [
2323  'type' => 'datetime',
2324  'default' => 16362836,
2325  ],
2326  ],
2327  'dColumn' => [
2328  'config' => [
2329  'type' => 'datetime',
2330  ],
2331  ],
2332  'eColumn' => [
2333  'config' => [
2334  'type' => 'datetime',
2335  'default' => time(),
2336  ],
2337  ],
2338  ],
2339  ],
2340  ],
2341  ];
2342  }
2343 
2344  #[DataProvider('renderTypeInputDateTimeMigratedToTypeDatetimeDataProvider')]
2345  #[Test]
2346  public function ‪renderTypeInputDateTimeMigratedToTypeDatetime(array $input, array $expected): void
2347  {
2348  $subject = new ‪TcaMigration();
2349  self::assertSame($expected, $subject->migrate($input));
2350  }
2351 
2352  #[Test]
2353  public function ‪authModeEnforceIsRemoved(): void
2354  {
2355  $input = [
2356  'aTable' => [
2357  'columns' => [
2358  'aColumn' => [
2359  'config' => [
2360  'type' => 'select',
2361  'renderType' => 'selectSingle',
2362  'authMode' => 'explicitAllow',
2363  'authMode_enforce' => 'strict',
2364  ],
2365  ],
2366  'bColumn' => [
2367  'config' => [
2368  'type' => 'select',
2369  'renderType' => 'selectSingle',
2370  'authMode' => 'explicitAllow',
2371  // This is an invalid value, but still removed
2372  'authMode_enforce' => 'foo',
2373  ],
2374  ],
2375  ],
2376  ],
2377  ];
2378  $expected = [
2379  'aTable' => [
2380  'columns' => [
2381  'aColumn' => [
2382  'config' => [
2383  'type' => 'select',
2384  'renderType' => 'selectSingle',
2385  'authMode' => 'explicitAllow',
2386  ],
2387  ],
2388  'bColumn' => [
2389  'config' => [
2390  'type' => 'select',
2391  'renderType' => 'selectSingle',
2392  'authMode' => 'explicitAllow',
2393  ],
2394  ],
2395  ],
2396  ],
2397  ];
2398  self::assertSame($expected, (new ‪TcaMigration())->migrate($input));
2399  }
2400 
2401  #[Test]
2402  public function ‪authModeValuesAreEnforced(): void
2403  {
2404  $input = [
2405  'aTable' => [
2406  'columns' => [
2407  'aColumn' => [
2408  'config' => [
2409  'type' => 'select',
2410  'renderType' => 'selectSingle',
2411  // good
2412  'authMode' => 'explicitAllow',
2413  ],
2414  ],
2415  'bColumn' => [
2416  'config' => [
2417  'type' => 'select',
2418  'renderType' => 'selectSingle',
2419  // forced to 'explicitAllow'
2420  'authMode' => 'explicitDeny',
2421  ],
2422  ],
2423  'cColumn' => [
2424  'config' => [
2425  'type' => 'select',
2426  'renderType' => 'selectSingle',
2427  // forced to 'explicitAllow'
2428  'authMode' => 'individual',
2429  ],
2430  ],
2431  'dColumn' => [
2432  'config' => [
2433  'type' => 'select',
2434  'renderType' => 'selectSingle',
2435  // forced to 'explicitAllow'
2436  'authMode' => 'foo',
2437  ],
2438  ],
2439  ],
2440  ],
2441  ];
2442  $expected = [
2443  'aTable' => [
2444  'columns' => [
2445  'aColumn' => [
2446  'config' => [
2447  'type' => 'select',
2448  'renderType' => 'selectSingle',
2449  'authMode' => 'explicitAllow',
2450  ],
2451  ],
2452  'bColumn' => [
2453  'config' => [
2454  'type' => 'select',
2455  'renderType' => 'selectSingle',
2456  'authMode' => 'explicitAllow',
2457  ],
2458  ],
2459  'cColumn' => [
2460  'config' => [
2461  'type' => 'select',
2462  'renderType' => 'selectSingle',
2463  'authMode' => 'explicitAllow',
2464  ],
2465  ],
2466  'dColumn' => [
2467  'config' => [
2468  'type' => 'select',
2469  'renderType' => 'selectSingle',
2470  'authMode' => 'explicitAllow',
2471  ],
2472  ],
2473  ],
2474  ],
2475  ];
2476  self::assertSame($expected, (new ‪TcaMigration())->migrate($input));
2477  }
2478 
2480  {
2481  yield 'keyword EXPL_ALLOW at position 5 in times array' => [
2482  'tca' => [
2483  'aTable' => [
2484  'columns' => [
2485  'aColumn' => [
2486  'config' => [
2487  'type' => 'select',
2488  'authMode' => 'individual',
2489  'items' => [
2490  [
2491  'Label 1',
2492  'Value 1',
2493  null,
2494  null,
2495  'EXPL_ALLOW',
2496  ],
2497  ],
2498  ],
2499  ],
2500  ],
2501  ],
2502  ],
2503  'expected' => [
2504  'aTable' => [
2505  'columns' => [
2506  'aColumn' => [
2507  'config' => [
2508  'type' => 'select',
2509  'authMode' => 'explicitAllow',
2510  'items' => [
2511  [
2512  'label' => 'Label 1',
2513  'value' => 'Value 1',
2514  'icon' => null,
2515  'group' => null,
2516  'description' => '',
2517  ],
2518  ],
2519  ],
2520  ],
2521  ],
2522  ],
2523  ],
2524  ];
2525  yield 'keyword EXPL_DENY at position 5 in times array' => [
2526  'tca' => [
2527  'aTable' => [
2528  'columns' => [
2529  'aColumn' => [
2530  'config' => [
2531  'type' => 'select',
2532  'authMode' => 'individual',
2533  'items' => [
2534  [
2535  'Label 1',
2536  'Value 1',
2537  null,
2538  null,
2539  'EXPL_DENY',
2540  ],
2541  ],
2542  ],
2543  ],
2544  ],
2545  ],
2546  ],
2547  'expected' => [
2548  'aTable' => [
2549  'columns' => [
2550  'aColumn' => [
2551  'config' => [
2552  'type' => 'select',
2553  'authMode' => 'explicitAllow',
2554  'items' => [
2555  [
2556  'label' => 'Label 1',
2557  'value' => 'Value 1',
2558  'icon' => null,
2559  'group' => null,
2560  'description' => '',
2561  ],
2562  ],
2563  ],
2564  ],
2565  ],
2566  ],
2567  ],
2568  ];
2569  yield 'keyword in items array NOT migrated to new position' => [
2570  'tca' => [
2571  'aTable' => [
2572  'columns' => [
2573  'aColumn' => [
2574  'config' => [
2575  'type' => 'select',
2576  'authMode' => 'individual',
2577  'items' => [
2578  [
2579  'Label 1',
2580  'Value 1',
2581  null,
2582  null,
2583  'EXPL_DENY',
2584  ],
2585  [
2586  'Label 2',
2587  'Value 2',
2588  null,
2589  null,
2590  'Description 2',
2591  ],
2592  ],
2593  ],
2594  ],
2595  ],
2596  ],
2597  ],
2598  'expected' => [
2599  'aTable' => [
2600  'columns' => [
2601  'aColumn' => [
2602  'config' => [
2603  'type' => 'select',
2604  'authMode' => 'explicitAllow',
2605  'items' => [
2606  [
2607  'label' => 'Label 1',
2608  'value' => 'Value 1',
2609  'icon' => null,
2610  'group' => null,
2611  'description' => '',
2612  ],
2613  [
2614  'label' => 'Label 2',
2615  'value' => 'Value 2',
2616  'icon' => null,
2617  'group' => null,
2618  'description' => 'Description 2',
2619  ],
2620  ],
2621  ],
2622  ],
2623  ],
2624  ],
2625  ],
2626  ];
2627  yield 'items array NOT migrated to new position without authMode=individual set' => [
2628  'tca' => [
2629  'aTable' => [
2630  'columns' => [
2631  'aColumn' => [
2632  'config' => [
2633  'type' => 'select',
2634  'authMode' => 'explicitAllow',
2635  'items' => [
2636  [
2637  'Label 1',
2638  'Value 1',
2639  null,
2640  null,
2641  'Description',
2642  ],
2643  ],
2644  ],
2645  ],
2646  ],
2647  ],
2648  ],
2649  'expected' => [
2650  'aTable' => [
2651  'columns' => [
2652  'aColumn' => [
2653  'config' => [
2654  'type' => 'select',
2655  'authMode' => 'explicitAllow',
2656  'items' => [
2657  [
2658  'label' => 'Label 1',
2659  'value' => 'Value 1',
2660  'icon' => null,
2661  'group' => null,
2662  'description' => 'Description',
2663  ],
2664  ],
2665  ],
2666  ],
2667  ],
2668  ],
2669  ],
2670  ];
2671  yield 'position 6 is unset' => [
2672  'tca' => [
2673  'aTable' => [
2674  'columns' => [
2675  'aColumn' => [
2676  'config' => [
2677  'type' => 'select',
2678  'authMode' => 'individual',
2679  'items' => [
2680  [
2681  'Label 1',
2682  'Value 1',
2683  null,
2684  null,
2685  'Description',
2686  'EXPL_ALLOW',
2687  ],
2688  [
2689  'Label 1',
2690  'Value 1',
2691  null,
2692  null,
2693  'Description',
2694  'EXPL_DENY',
2695  ],
2696  [
2697  'Label 1',
2698  'Value 1',
2699  null,
2700  null,
2701  'Description',
2702  'somethingElse',
2703  ],
2704  ],
2705  ],
2706  ],
2707  ],
2708  ],
2709  ],
2710  'expected' => [
2711  'aTable' => [
2712  'columns' => [
2713  'aColumn' => [
2714  'config' => [
2715  'type' => 'select',
2716  'authMode' => 'explicitAllow',
2717  'items' => [
2718  [
2719  'label' => 'Label 1',
2720  'value' => 'Value 1',
2721  'icon' => null,
2722  'group' => null,
2723  'description' => 'Description',
2724  ],
2725  [
2726  'label' => 'Label 1',
2727  'value' => 'Value 1',
2728  'icon' => null,
2729  'group' => null,
2730  'description' => 'Description',
2731  ],
2732  [
2733  'label' => 'Label 1',
2734  'value' => 'Value 1',
2735  'icon' => null,
2736  'group' => null,
2737  'description' => 'Description',
2738  ],
2739  ],
2740  ],
2741  ],
2742  ],
2743  ],
2744  ],
2745  ];
2746  }
2747 
2748  #[DataProvider('selectIndividualAllowDenyMigratedToNewPositionDataProvider')]
2749  #[Test]
2750  public function ‪selectIndividualAllowDenyMigratedToNewPosition(array ‪$tca, array $expected): void
2751  {
2752  $subject = new ‪TcaMigration();
2753  self::assertEquals($expected, $subject->migrate(‪$tca));
2754  }
2755 
2756  public static function ‪renderTypeColorpickerToTypeColorDataProvider(): iterable
2757  {
2758  yield 'Full example of renderType=colorpicker migrated to type=color' => [
2759  'input' => [
2760  'aTable' => [
2761  'columns' => [
2762  'aColumn' => [
2763  'config' => [
2764  'type' => 'input',
2765  'renderType' => 'colorpicker',
2766  'required' => true,
2767  'nullable' => true,
2768  'size' => 20,
2769  'max' => 1234,
2770  'eval' => 'trim',
2771  'valuePicker' => [
2772  'items' => [
2773  [ 'typo3 orange', '#FF8700'],
2774  ],
2775  ],
2776  ],
2777  ],
2778  ],
2779  ],
2780  ],
2781  'expected' => [
2782  'aTable' => [
2783  'columns' => [
2784  'aColumn' => [
2785  'config' => [
2786  'type' => 'color',
2787  'required' => true,
2788  'nullable' => true,
2789  'size' => 20,
2790  'valuePicker' => [
2791  'items' => [
2792  ['typo3 orange', '#FF8700'],
2793  ],
2794  ],
2795  ],
2796  ],
2797  ],
2798  ],
2799  ],
2800  ];
2801  yield 'eval gets unset' => [
2802  'input' => [
2803  'aTable' => [
2804  'columns' => [
2805  'aColumn' => [
2806  'config' => [
2807  'type' => 'input',
2808  'renderType' => 'colorpicker',
2809  'eval' => 'trim',
2810  ],
2811  ],
2812  ],
2813  ],
2814  ],
2815  'expected' => [
2816  'aTable' => [
2817  'columns' => [
2818  'aColumn' => [
2819  'config' => [
2820  'type' => 'color',
2821  ],
2822  ],
2823  ],
2824  ],
2825  ],
2826  ];
2827  }
2828 
2829  #[DataProvider('renderTypeColorpickerToTypeColorDataProvider')]
2830  #[Test]
2831  public function ‪renderTypeColorpickerToTypeColor(array $input, array $expected): void
2832  {
2833  $subject = new ‪TcaMigration();
2834  self::assertSame($expected, $subject->migrate($input));
2835  }
2836 
2838  {
2839  yield 'Full example of eval=double2 migrated to type=number' => [
2840  'input' => [
2841  'aTable' => [
2842  'columns' => [
2843  'aColumn' => [
2844  'config' => [
2845  'type' => 'input',
2846  'size' => 10,
2847  'max' => 20,
2848  'required' => true,
2849  'nullable' => true,
2850  'default' => 40,
2851  'eval' => 'trim,double2',
2852  'range' => [
2853  'lower' => 0,
2854  ],
2855  'slider' => [
2856  'step' => 10,
2857  ],
2858  ],
2859  ],
2860  ],
2861  ],
2862  ],
2863  'expected' => [
2864  'aTable' => [
2865  'columns' => [
2866  'aColumn' => [
2867  'config' => [
2868  'type' => 'number',
2869  'size' => 10,
2870  'required' => true,
2871  'nullable' => true,
2872  'default' => 40,
2873  'range' => [
2874  'lower' => 0,
2875  ],
2876  'slider' => [
2877  'step' => 10,
2878  ],
2879  'format' => 'decimal',
2880  ],
2881  ],
2882  ],
2883  ],
2884  ],
2885  ];
2886 
2887  yield 'type input with eval int migrated to type number and eval removed' => [
2888  'input' => [
2889  'aTable' => [
2890  'columns' => [
2891  'aColumn' => [
2892  'config' => [
2893  'type' => 'input',
2894  'eval' => 'trim,int',
2895  ],
2896  ],
2897  ],
2898  ],
2899  ],
2900  'expected' => [
2901  'aTable' => [
2902  'columns' => [
2903  'aColumn' => [
2904  'config' => [
2905  'type' => 'number',
2906  ],
2907  ],
2908  ],
2909  ],
2910  ],
2911  ];
2912 
2913  yield 'type input with eval double2 migrated to type="number" and format="decimal"' => [
2914  'input' => [
2915  'aTable' => [
2916  'columns' => [
2917  'aColumn' => [
2918  'config' => [
2919  'type' => 'input',
2920  'eval' => 'trim,double2,uniqueInPid',
2921  ],
2922  ],
2923  ],
2924  ],
2925  ],
2926  'expected' => [
2927  'aTable' => [
2928  'columns' => [
2929  'aColumn' => [
2930  'config' => [
2931  'type' => 'number',
2932  'format' => 'decimal',
2933  ],
2934  ],
2935  ],
2936  ],
2937  ],
2938  ];
2939 
2940  yield 'type input without eval int or double2 not migrated' => [
2941  'input' => [
2942  'aTable' => [
2943  'columns' => [
2944  'aColumn' => [
2945  'config' => [
2946  'type' => 'input',
2947  'eval' => 'trim,uniqueInPid',
2948  ],
2949  ],
2950  ],
2951  ],
2952  ],
2953  'expected' => [
2954  'aTable' => [
2955  'columns' => [
2956  'aColumn' => [
2957  'config' => [
2958  'type' => 'input',
2959  'eval' => 'trim,uniqueInPid',
2960  ],
2961  ],
2962  ],
2963  ],
2964  ],
2965  ];
2966 
2967  yield 'type input with a renderType defined not migrated to type number' => [
2968  'input' => [
2969  'aTable' => [
2970  'columns' => [
2971  'aColumn' => [
2972  'config' => [
2973  'type' => 'input',
2974  'renderType' => 'someRenderType',
2975  'eval' => 'int,date',
2976  ],
2977  ],
2978  ],
2979  ],
2980  ],
2981  'expected' => [
2982  'aTable' => [
2983  'columns' => [
2984  'aColumn' => [
2985  'config' => [
2986  'type' => 'input',
2987  'renderType' => 'someRenderType',
2988  'eval' => 'int,date',
2989  ],
2990  ],
2991  ],
2992  ],
2993  ],
2994  ];
2995  }
2996 
3001  #[DataProvider('typeTextWithEvalIntOrDouble2MigratedToTypeNumberDataProvider')]
3002  #[Test]
3003  public function ‪typeTextWithEvalIntOrDouble2MigratedToTypeNumber(array $input, array $expected): void
3004  {
3005  $subject = new ‪TcaMigration();
3006  self::assertSame($expected, $subject->migrate($input));
3007  }
3008 
3009  public static function ‪propertyAlwaysDescriptionIsRemovedDataProvider(): iterable
3010  {
3011  yield 'always_description is removed' => [
3012  'input' => [
3013  'aTable' => [
3014  'interface' => [
3015  'always_description' => 0,
3016  'anything_else' => true,
3017  ],
3018  'columns' => [],
3019  ],
3020  ],
3021  'expected' => [
3022  'aTable' => [
3023  'interface' => [
3024  'anything_else' => true,
3025  ],
3026  'columns' => [],
3027  ],
3028  ],
3029  ];
3030 
3031  yield 'interface is removed if empty' => [
3032  'input' => [
3033  'aTable' => [
3034  'interface' => [
3035  'always_description' => 0,
3036  ],
3037  'columns' => [],
3038  ],
3039  ],
3040  'expected' => [
3041  'aTable' => [
3042  'columns' => [],
3043  ],
3044  ],
3045  ];
3046  }
3047 
3052  #[DataProvider('propertyAlwaysDescriptionIsRemovedDataProvider')]
3053  #[Test]
3054  public function ‪propertyAlwaysDescriptionIsRemoved(array $input, array $expected): void
3055  {
3056  $subject = new ‪TcaMigration();
3057  self::assertSame($expected, $subject->migrate($input));
3058  }
3059 
3060  #[Test]
3061  public function ‪ctrlCruserIdIsRemoved(): void
3062  {
3063  $input = [
3064  'aTable' => [
3065  'ctrl' => [
3066  'cruser_id' => 'cruser_id',
3067  ],
3068  ],
3069  ];
3070  $expected = [
3071  'aTable' => [
3072  'ctrl' => [
3073  ],
3074  ],
3075  ];
3076  $subject = new ‪TcaMigration();
3077  self::assertSame($expected, $subject->migrate($input));
3078  }
3079 
3081  {
3082  yield 'Full example of type=inline with foreign_table=sys_file_reference migrated to type=file' => [
3083  'input' => [
3084  'aTable' => [
3085  'columns' => [
3086  'aColumn' => [
3087  'config' => [
3088  'type' => 'inline',
3089  'minitems' => 1,
3090  'maxitems' => 2,
3091  'foreign_field' => 'uid_foreign',
3092  'foreign_label' => 'uid_local',
3093  'foreign_match_fields' => [
3094  'fieldname' => 'aColumn',
3095  ],
3096  'foreign_selector' => 'uid_local',
3097  'foreign_unique' => 'uid_local',
3098  'foreign_sortby' => 'sorting_foreign',
3099  'foreign_table' => 'sys_file_reference',
3100  'foreign_table_field' => 'tablenames',
3101  'appearance' => [
3102  'createNewRelationLinkTitle' => 'Add file',
3103  'enabledControls' => [
3104  'delete' => true,
3105  'dragdrop' => true,
3106  'sort' => false,
3107  'hide' => true,
3108  'info' => true,
3109  'new' => false,
3110  ],
3111  'headerThumbnail' => [
3112  'field' => 'uid_local',
3113  'height' => '45m',
3114  ],
3115  'showPossibleLocalizationRecords' => true,
3116  'useSortable' => true,
3117  'showNewRecordLink' => true,
3118  'newRecordLinkAddTitle' => true,
3119  'newRecordLinkTitle' => true,
3120  'levelLinksPosition' => 'both',
3121  'useCombination' => true,
3122  'suppressCombinationWarning' => true,
3123  ],
3124  'filter' => [
3125  [
3126  'userFunc' => FileExtensionFilter::class . '->filterInlineChildren',
3127  'parameters' => [
3128  'allowedFileExtensions' => 'jpg,png',
3129  'disallowedFileExtensions' => '',
3130  ],
3131  ],
3132  ],
3133  'overrideChildTca' => [
3134  'columns' => [
3135  'uid_local' => [
3136  'config' => [
3137  'appearance' => [
3138  'elementBrowserAllowed' => 'jpg,png',
3139  'elementBrowserType' => 'file',
3140  ],
3141  ],
3142  ],
3143  ],
3144  'types' => [
3145  '0' => [
3146  'showitem' => '--palette--;;somePalette',
3147  ],
3148  ],
3149  ],
3150  ],
3151  ],
3152  ],
3153  ],
3154  ],
3155  'expected' => [
3156  'aTable' => [
3157  'columns' => [
3158  'aColumn' => [
3159  'config' => [
3160  'type' => 'file',
3161  'minitems' => 1,
3162  'maxitems' => 2,
3163  'appearance' => [
3164  'createNewRelationLinkTitle' => 'Add file',
3165  'enabledControls' => [
3166  'delete' => true,
3167  'dragdrop' => true,
3168  'sort' => false,
3169  'hide' => true,
3170  'info' => true,
3171  ],
3172  'headerThumbnail' => [
3173  'height' => '45m',
3174  ],
3175  'showPossibleLocalizationRecords' => true,
3176  'useSortable' => true,
3177  ],
3178  'overrideChildTca' => [
3179  'types' => [
3180  '0' => [
3181  'showitem' => '--palette--;;somePalette',
3182  ],
3183  ],
3184  ],
3185  'allowed' => 'jpg,png',
3186  ],
3187  ],
3188  ],
3189  ],
3190  ],
3191  ];
3192  yield 'Allowed and disallowed list is migrated from unused filter' => [
3193  'input' => [
3194  'aTable' => [
3195  'columns' => [
3196  'aColumn' => [
3197  'config' => [
3198  'type' => 'inline',
3199  'foreign_table' => 'sys_file_reference',
3200  'filter' => [
3201  [
3202  'userFunc' => FileExtensionFilter::class . '->filterInlineChildren',
3203  'parameters' => [
3204  'allowedFileExtensions' => 'jpg,png',
3205  'disallowedFileExtensions' => 'pdf,pages',
3206  ],
3207  ],
3208  ],
3209  ],
3210  ],
3211  ],
3212  ],
3213  ],
3214  'expected' => [
3215  'aTable' => [
3216  'columns' => [
3217  'aColumn' => [
3218  'config' => [
3219  'type' => 'file',
3220  'allowed' => 'jpg,png',
3221  'disallowed' => 'pdf,pages',
3222  ],
3223  ],
3224  ],
3225  ],
3226  ],
3227  ];
3228  yield 'Allowed list from filter takes precedence over element browser related option' => [
3229  'input' => [
3230  'aTable' => [
3231  'columns' => [
3232  'aColumn' => [
3233  'config' => [
3234  'type' => 'inline',
3235  'foreign_table' => 'sys_file_reference',
3236  'overrideChildTca' => [
3237  'columns' => [
3238  'uid_local' => [
3239  'config' => [
3240  'appearance' => [
3241  'elementBrowserAllowed' => 'jpg,png',
3242  ],
3243  ],
3244  ],
3245  ],
3246  ],
3247  'filter' => [
3248  [
3249  'userFunc' => FileExtensionFilter::class . '->filterInlineChildren',
3250  'parameters' => [
3251  'allowedFileExtensions' => 'pdf,docx',
3252  ],
3253  ],
3254  ],
3255  ],
3256  ],
3257  ],
3258  ],
3259  ],
3260  'expected' => [
3261  'aTable' => [
3262  'columns' => [
3263  'aColumn' => [
3264  'config' => [
3265  'type' => 'file',
3266  'allowed' => 'pdf,docx',
3267  ],
3268  ],
3269  ],
3270  ],
3271  ],
3272  ];
3273  yield 'renamed appearance options are migrated' => [
3274  'input' => [
3275  'aTable' => [
3276  'columns' => [
3277  'aColumn' => [
3278  'config' => [
3279  'type' => 'inline',
3280  'foreign_table' => 'sys_file_reference',
3281  'appearance' => [
3282  'showPossibleRecordsSelector' => false,
3283  ],
3284  ],
3285  ],
3286  ],
3287  ],
3288  ],
3289  'expected' => [
3290  'aTable' => [
3291  'columns' => [
3292  'aColumn' => [
3293  'config' => [
3294  'type' => 'file',
3295  'appearance' => [
3296  'showFileSelectors' => false,
3297  ],
3298  ],
3299  ],
3300  ],
3301  ],
3302  ],
3303  ];
3304  yield 'Usage of sys_file_reference as foreign_table without type=inline is still possible' => [
3305  'input' => [
3306  'aTable' => [
3307  'columns' => [
3308  'aColumn' => [
3309  'config' => [
3310  'type' => 'select',
3311  'foreign_table' => 'sys_file_reference',
3312  ],
3313  ],
3314  ],
3315  ],
3316  ],
3317  'expected' => [
3318  'aTable' => [
3319  'columns' => [
3320  'aColumn' => [
3321  'config' => [
3322  'type' => 'select',
3323  'foreign_table' => 'sys_file_reference',
3324  ],
3325  ],
3326  ],
3327  ],
3328  ],
3329  ];
3330  }
3331 
3337  #[DataProvider('falHandlingInTypeInlineIsMigratedToTypeFileDataProvider')]
3338  #[Test]
3339  public function ‪falHandlingInTypeInlineIsMigratedToTypeFile(array $input, array $expected, $expectedMessagePart = ''): void
3340  {
3341  $subject = new ‪TcaMigration();
3342  self::assertSame($expected, $subject->migrate($input));
3343  if ($expectedMessagePart !== '') {
3344  $messageFound = false;
3345  foreach ($subject->getMessages() as $message) {
3346  if (str_contains($message, $expectedMessagePart)) {
3347  $messageFound = true;
3348  break;
3349  }
3350  }
3351  self::assertTrue($messageFound);
3352  }
3353  }
3354 
3355  #[Test]
3357  {
3358  $input = [
3359  'aTable' => [
3360  'columns' => [
3361  'aColumns' => [
3362  'config' => [
3363  'type' => 'group',
3364  'appearance' => [
3365  'elementBrowserAllowed' => 'jpg,png',
3366  'elementBrowserType' => 'file',
3367  ],
3368  ],
3369  ],
3370  ],
3371  ],
3372  ];
3373  $expected = [
3374  'aTable' => [
3375  'columns' => [
3376  'aColumns' => [
3377  'config' => [
3378  'type' => 'group',
3379  ],
3380  ],
3381  ],
3382  ],
3383  ];
3384  $subject = new ‪TcaMigration();
3385  self::assertSame($expected, $subject->migrate($input));
3386  }
3387 
3388  #[Test]
3390  {
3391  $input = [
3392  'aTable' => [
3393  'columns' => [
3394  'aColumns' => [
3395  'config' => [
3396  'type' => 'inline',
3397  'appearance' => [
3398  'headerThumbnail' => [
3399  'height' => '45c',
3400  ],
3401  'fileUploadAllowed' => true,
3402  'fileByUrlAllowed' => true,
3403  ],
3404  ],
3405  ],
3406  ],
3407  ],
3408  ];
3409  $expected = [
3410  'aTable' => [
3411  'columns' => [
3412  'aColumns' => [
3413  'config' => [
3414  'type' => 'inline',
3415  ],
3416  ],
3417  ],
3418  ],
3419  ];
3420  $subject = new ‪TcaMigration();
3421  self::assertSame($expected, $subject->migrate($input));
3422  }
3423 
3424  #[Test]
3425  public function ‪passContentIsRemovedFromTypeNone(): void
3426  {
3427  $input = [
3428  'aTable' => [
3429  'columns' => [
3430  'aColumn' => [
3431  'config' => [
3432  'type' => 'none',
3433  'pass_content' => false,
3434  ],
3435  ],
3436  'bColumn' => [
3437  'config' => [
3438  'type' => 'input',
3439  'pass_content' => false,
3440  ],
3441  ],
3442  ],
3443  ],
3444  ];
3445  $expected = [
3446  'aTable' => [
3447  'columns' => [
3448  'aColumn' => [
3449  'config' => [
3450  'type' => 'none',
3451  ],
3452  ],
3453  'bColumn' => [
3454  'config' => [
3455  'type' => 'input',
3456  'pass_content' => false,
3457  ],
3458  ],
3459  ],
3460  ],
3461  ];
3462  self::assertSame($expected, (new ‪TcaMigration())->migrate($input));
3463  }
3464 
3465  #[Test]
3467  {
3468  $input = [
3469  'aTable' => [
3470  'columns' => [
3471  'aColumn' => [
3472  'config' => [
3473  'type' => 'select',
3474  'renderType' => 'selectSingle',
3475  'items' => [
3476  [
3477  'foo',
3478  'bar',
3479  'baz',
3480  'bee',
3481  'boo',
3482  ],
3483  ],
3484  ],
3485  ],
3486  'bColumn' => [
3487  'config' => [
3488  'type' => 'radio',
3489  'items' => [
3490  [
3491  'foo',
3492  'bar',
3493  ],
3494  ],
3495  ],
3496  ],
3497  'cColumn' => [
3498  'config' => [
3499  'type' => 'check',
3500  'items' => [
3501  [
3502  0 => 'foo',
3503  'invertStateDisplay' => true,
3504  ],
3505  ],
3506  ],
3507  ],
3508  'dColumn' => [
3509  'config' => [
3510  'type' => 'foo',
3511  'items' => [
3512  [
3513  'foo',
3514  'bar',
3515  ],
3516  ],
3517  ],
3518  ],
3519  ],
3520  ],
3521  ];
3522  $expected = [
3523  'aTable' => [
3524  'columns' => [
3525  'aColumn' => [
3526  'config' => [
3527  'type' => 'select',
3528  'renderType' => 'selectSingle',
3529  'items' => [
3530  [
3531  'label' => 'foo',
3532  'value' => 'bar',
3533  'icon' => 'baz',
3534  'group' => 'bee',
3535  'description' => 'boo',
3536  ],
3537  ],
3538  ],
3539  ],
3540  'bColumn' => [
3541  'config' => [
3542  'type' => 'radio',
3543  'items' => [
3544  [
3545  'label' => 'foo',
3546  'value' => 'bar',
3547  ],
3548  ],
3549  ],
3550  ],
3551  'cColumn' => [
3552  'config' => [
3553  'type' => 'check',
3554  'items' => [
3555  [
3556  'invertStateDisplay' => true,
3557  'label' => 'foo',
3558  ],
3559  ],
3560  ],
3561  ],
3562  'dColumn' => [
3563  'config' => [
3564  'type' => 'foo',
3565  'items' => [
3566  [
3567  'foo',
3568  'bar',
3569  ],
3570  ],
3571  ],
3572  ],
3573  ],
3574  ],
3575  ];
3576 
3577  self::assertSame($expected, (new ‪TcaMigration())->migrate($input));
3578  }
3579 
3580  #[Test]
3581  public function ‪migrationRemovesMmInsertFields(): void
3582  {
3583  $input = [
3584  'aTable' => [
3585  'columns' => [
3586  'aColumn' => [
3587  'config' => [
3588  'type' => 'group',
3589  'MM_insert_fields' => [
3590  'aField' => 'aValue',
3591  ],
3592  ],
3593  ],
3594  ],
3595  ],
3596  ];
3597  $expected = [
3598  'aTable' => [
3599  'columns' => [
3600  'aColumn' => [
3601  'config' => [
3602  'type' => 'group',
3603  ],
3604  ],
3605  ],
3606  ],
3607  ];
3608  self::assertSame($expected, (new ‪TcaMigration())->migrate($input));
3609  }
3610 
3611  #[Test]
3613  {
3614  $input = [
3615  'aTable' => [
3616  'columns' => [
3617  'aColumn' => [
3618  'config' => [
3619  'type' => 'group',
3620  'MM_hasUidField' => false,
3621  ],
3622  ],
3623  ],
3624  ],
3625  ];
3626  $expected = [
3627  'aTable' => [
3628  'columns' => [
3629  'aColumn' => [
3630  'config' => [
3631  'type' => 'group',
3632  ],
3633  ],
3634  ],
3635  ],
3636  ];
3637  self::assertSame($expected, (new ‪TcaMigration())->migrate($input));
3638  }
3639 
3640  #[Test]
3642  {
3643  $input = [
3644  'aTable' => [
3645  'columns' => [
3646  'aColumn' => [
3647  'config' => [
3648  'type' => 'group',
3649  'MM_hasUidField' => true,
3650  ],
3651  ],
3652  ],
3653  ],
3654  ];
3655  $expected = [
3656  'aTable' => [
3657  'columns' => [
3658  'aColumn' => [
3659  'config' => [
3660  'type' => 'group',
3661  ],
3662  ],
3663  ],
3664  ],
3665  ];
3666  self::assertSame($expected, (new ‪TcaMigration())->migrate($input));
3667  }
3668 
3669  #[Test]
3671  {
3672  $input = [
3673  'aTable' => [
3674  'columns' => [
3675  'aColumn' => [
3676  'config' => [
3677  'type' => 'text',
3678  'renderType' => 't3editor',
3679  ],
3680  ],
3681  'bColumn' => [
3682  'config' => [
3683  'type' => 'text',
3684  ],
3685  ],
3686  ],
3687  'types' => [
3688  'aType' => [
3689  'columnsOverrides' => [
3690  'bColumn' => [
3691  'config' => [
3692  'renderType' => 't3editor',
3693  ],
3694  ],
3695  ],
3696  ],
3697  ],
3698  ],
3699  ];
3700  $expected = [
3701  'aTable' => [
3702  'columns' => [
3703  'aColumn' => [
3704  'config' => [
3705  'type' => 'text',
3706  'renderType' => 'codeEditor',
3707  ],
3708  ],
3709  'bColumn' => [
3710  'config' => [
3711  'type' => 'text',
3712  ],
3713  ],
3714  ],
3715  'types' => [
3716  'aType' => [
3717  'columnsOverrides' => [
3718  'bColumn' => [
3719  'config' => [
3720  'renderType' => 'codeEditor',
3721  ],
3722  ],
3723  ],
3724  ],
3725  ],
3726  ],
3727  ];
3728  self::assertSame($expected, (new ‪TcaMigration())->migrate($input));
3729  }
3730 }
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\migrateAddsMissingColumnsConfig
‪migrateAddsMissingColumnsConfig()
Definition: TcaMigrationTest.php:85
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\showRemovedLocalizationRecordsRemoved
‪showRemovedLocalizationRecordsRemoved()
Definition: TcaMigrationTest.php:802
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\removeEnableMultiSelectFilterTextfieldConfigurationIsRemoved
‪removeEnableMultiSelectFilterTextfieldConfigurationIsRemoved()
Definition: TcaMigrationTest.php:414
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\evalNullMigratedToNullableOptionDataProvider
‪static evalNullMigratedToNullableOptionDataProvider()
Definition: TcaMigrationTest.php:1420
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\evalEmailMigratedToType
‪evalEmailMigratedToType(array $input, array $expected)
Definition: TcaMigrationTest.php:1637
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\selectIndividualAllowDenyMigratedToNewPositionDataProvider
‪static selectIndividualAllowDenyMigratedToNewPositionDataProvider()
Definition: TcaMigrationTest.php:2479
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\migrationRemovesMmInsertFields
‪migrationRemovesMmInsertFields()
Definition: TcaMigrationTest.php:3581
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\migrateReturnsGivenArrayUnchangedIfNoMigrationNeeded
‪migrateReturnsGivenArrayUnchangedIfNoMigrationNeeded()
Definition: TcaMigrationTest.php:57
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\itemsAreMigratedToAssociatedArray
‪itemsAreMigratedToAssociatedArray()
Definition: TcaMigrationTest.php:3466
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\internalTypeFolderMigratedToType
‪internalTypeFolderMigratedToType(array $input, array $expected)
Definition: TcaMigrationTest.php:1296
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\ctrlIntegrityColumnsAreAvailable
‪ctrlIntegrityColumnsAreAvailable(array $tca, array $expectation)
Definition: TcaMigrationTest.php:407
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\migrationChangesRenderTypeFromT3Editor
‪migrationChangesRenderTypeFromT3Editor()
Definition: TcaMigrationTest.php:3670
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\propertyAlwaysDescriptionIsRemoved
‪propertyAlwaysDescriptionIsRemoved(array $input, array $expected)
Definition: TcaMigrationTest.php:3054
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\migrationRemovesMmHasUidFieldIfTrue
‪migrationRemovesMmHasUidFieldIfTrue()
Definition: TcaMigrationTest.php:3641
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\evalNullMigratedToNullableOption
‪evalNullMigratedToNullableOption(array $tca, array $expected)
Definition: TcaMigrationTest.php:1536
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\ctrlIntegrityColumnsAreAvailableDataProvider
‪static ctrlIntegrityColumnsAreAvailableDataProvider()
Definition: TcaMigrationTest.php:209
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\authModeValuesAreEnforced
‪authModeValuesAreEnforced()
Definition: TcaMigrationTest.php:2402
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\ctrlShadowColumnsForMovePlaceholdersIsRemoved
‪ctrlShadowColumnsForMovePlaceholdersIsRemoved()
Definition: TcaMigrationTest.php:576
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\removeShowRecordFieldListFieldIsRemoved
‪removeShowRecordFieldListFieldIsRemoved()
Definition: TcaMigrationTest.php:545
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\typeTextWithEvalIntOrDouble2MigratedToTypeNumberDataProvider
‪static typeTextWithEvalIntOrDouble2MigratedToTypeNumberDataProvider()
Definition: TcaMigrationTest.php:2837
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\missingTypeThrowsException
‪missingTypeThrowsException()
Definition: TcaMigrationTest.php:29
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\migrationRemovesMmHasUidFieldIfFalse
‪migrationRemovesMmHasUidFieldIfFalse()
Definition: TcaMigrationTest.php:3612
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\falRelatedElementBrowserOptionsAreRemovedFromTypeGroup
‪falRelatedElementBrowserOptionsAreRemovedFromTypeGroup()
Definition: TcaMigrationTest.php:3356
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\renderTypeColorpickerToTypeColor
‪renderTypeColorpickerToTypeColor(array $input, array $expected)
Definition: TcaMigrationTest.php:2831
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\renderTypeInputLinkMigratedToTypeLink
‪renderTypeInputLinkMigratedToTypeLink(array $input, array $expected)
Definition: TcaMigrationTest.php:1943
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\languageFieldsAreMigratedToTcaTypeLanguage
‪languageFieldsAreMigratedToTcaTypeLanguage()
Definition: TcaMigrationTest.php:643
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\renderTypeColorpickerToTypeColorDataProvider
‪static renderTypeColorpickerToTypeColorDataProvider()
Definition: TcaMigrationTest.php:2756
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca
Definition: TcaMigrationTest.php:18
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\removeExcludeFieldForTransOrigPointerFieldIsRemoved
‪removeExcludeFieldForTransOrigPointerFieldIsRemoved()
Definition: TcaMigrationTest.php:465
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\renderTypeInputDateTimeMigratedToTypeDatetime
‪renderTypeInputDateTimeMigratedToTypeDatetime(array $input, array $expected)
Definition: TcaMigrationTest.php:2346
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest
Definition: TcaMigrationTest.php:27
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\falRelatedOptionsAreRemovedFromTypeInline
‪falRelatedOptionsAreRemovedFromTypeInline()
Definition: TcaMigrationTest.php:3389
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\typeNoneColsMigratedToSizeDataProvider
‪static typeNoneColsMigratedToSizeDataProvider()
Definition: TcaMigrationTest.php:1643
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\renderTypeInputLinkMigratedToTypeLinkDataProvider
‪static renderTypeInputLinkMigratedToTypeLinkDataProvider()
Definition: TcaMigrationTest.php:1711
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\ctrlSetToDefaultOnCopyIsRemoved
‪ctrlSetToDefaultOnCopyIsRemoved()
Definition: TcaMigrationTest.php:174
‪TYPO3\CMS\Core\Resource\Filter\FileExtensionFilter
Definition: FileExtensionFilter.php:31
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\ctrlCruserIdIsRemoved
‪ctrlCruserIdIsRemoved()
Definition: TcaMigrationTest.php:3061
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\renderTypeInputDateTimeMigratedToTypeDatetimeDataProvider
‪static renderTypeInputDateTimeMigratedToTypeDatetimeDataProvider()
Definition: TcaMigrationTest.php:2068
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\levelLinksPositionIsMigrated
‪levelLinksPositionIsMigrated()
Definition: TcaMigrationTest.php:1032
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\falHandlingInTypeInlineIsMigratedToTypeFile
‪falHandlingInTypeInlineIsMigratedToTypeFile(array $input, array $expected, $expectedMessagePart='')
Definition: TcaMigrationTest.php:3339
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\propertyAlwaysDescriptionIsRemovedDataProvider
‪static propertyAlwaysDescriptionIsRemovedDataProvider()
Definition: TcaMigrationTest.php:3009
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\requiredFlagIsMigratedDataProvider
‪static requiredFlagIsMigratedDataProvider()
Definition: TcaMigrationTest.php:1302
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\evalEmailMigratedToTypeDataProvider
‪static evalEmailMigratedToTypeDataProvider()
Definition: TcaMigrationTest.php:1542
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\evalPasswordSaltedPasswordMigratedToTypePassword
‪evalPasswordSaltedPasswordMigratedToTypePassword(array $input, array $expected)
Definition: TcaMigrationTest.php:2062
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\internalTypeFolderMigratedToTypeDataProvider
‪static internalTypeFolderMigratedToTypeDataProvider()
Definition: TcaMigrationTest.php:1250
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\passContentIsRemovedFromTypeNone
‪passContentIsRemovedFromTypeNone()
Definition: TcaMigrationTest.php:3425
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\authModeEnforceIsRemoved
‪authModeEnforceIsRemoved()
Definition: TcaMigrationTest.php:2353
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\ctrlSelIconFieldPathIsRemoved
‪ctrlSelIconFieldPathIsRemoved()
Definition: TcaMigrationTest.php:138
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\ctrlShadowColumnsForMoveAndPlaceholdersIsRemoved
‪ctrlShadowColumnsForMoveAndPlaceholdersIsRemoved()
Definition: TcaMigrationTest.php:609
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\falHandlingInTypeInlineIsMigratedToTypeFileDataProvider
‪static falHandlingInTypeInlineIsMigratedToTypeFileDataProvider()
Definition: TcaMigrationTest.php:3080
‪$tca
‪$tca
Definition: sys_file_metadata.php:5
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\fileFolderConfigurationIsMigrated
‪fileFolderConfigurationIsMigrated()
Definition: TcaMigrationTest.php:883
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\rootUidIsMigratedToStartingPositions
‪rootUidIsMigratedToStartingPositions()
Definition: TcaMigrationTest.php:1143
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\requiredFlagIsMigrated
‪requiredFlagIsMigrated(array $tca, array $expected)
Definition: TcaMigrationTest.php:1414
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\selectIndividualAllowDenyMigratedToNewPosition
‪selectIndividualAllowDenyMigratedToNewPosition(array $tca, array $expected)
Definition: TcaMigrationTest.php:2750
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\typeNoneColsMigratedToSize
‪typeNoneColsMigratedToSize(array $tca, array $expected)
Definition: TcaMigrationTest.php:1705
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\evalPasswordSaltedPasswordMigratedToTypePasswordDataProvider
‪static evalPasswordSaltedPasswordMigratedToTypePasswordDataProvider()
Definition: TcaMigrationTest.php:1949
‪TYPO3\CMS\Core\Tests\Unit\Configuration\Tca\TcaMigrationTest\typeTextWithEvalIntOrDouble2MigratedToTypeNumber
‪typeTextWithEvalIntOrDouble2MigratedToTypeNumber(array $input, array $expected)
Definition: TcaMigrationTest.php:3003
‪TYPO3\CMS\Core\Configuration\Tca\TcaMigration
Definition: TcaMigration.php:31