18 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
30 'foreign_table' =>
'aForeignTableName',
34 'levelLinksPosition' =>
'top',
35 'showPossibleLocalizationRecords' =>
false,
36 'showRemovedLocalizationRecords' =>
false,
37 'enabledControls' => [
55 'tableName' =>
'aTable',
67 $this->expectException(\UnexpectedValueException::class);
68 $this->expectExceptionCode(1443793404);
83 'foreign_table' =>
'aForeignTableName',
104 'foreign_table' =>
'aForeignTableName',
112 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'minitems'] = 23;
127 'foreign_table' =>
'aForeignTableName',
135 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'minitems'] = 0;
150 'foreign_table' =>
'aForeignTableName',
158 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'maxitems'] = 23;
173 'foreign_table' =>
'aForeignTableName',
181 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'maxitems'] = 1;
196 'foreign_table' =>
'aForeignTableName',
198 'levelLinksPosition' =>
'both',
199 'enabledControls' => [
209 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'levelLinksPosition'] =
'both';
210 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'enabledControls'][
'dragdrop'] =
false;
225 'foreign_table' =>
'aForeignTableName',
226 'foreign_selector' =>
'aField',
228 'levelLinksPosition' =>
'both',
235 $GLOBALS[
'TCA'][
'aForeignTableName'][
'columns'][
'aField'][
'config'] = [
237 'foreign_table' =>
'anotherForeignTableName',
240 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'foreign_selector'] =
'aField';
241 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'selectorOrUniqueConfiguration'] = [
242 'fieldName' =>
'aField',
243 'isSelector' =>
true,
247 'foreign_table' =>
'anotherForeignTableName',
249 'foreignTable' =>
'anotherForeignTableName',
251 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'levelLinksPosition'] =
'none';
266 'foreign_table' =>
'aForeignTableName',
267 'foreign_selector' =>
'aField',
269 'useCombination' =>
true,
270 'levelLinksPosition' =>
'both',
277 $GLOBALS[
'TCA'][
'aForeignTableName'][
'columns'][
'aField'][
'config'] = [
279 'foreign_table' =>
'anotherForeignTableName',
282 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'foreign_selector'] =
'aField';
283 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'selectorOrUniqueConfiguration'] = [
284 'fieldName' =>
'aField',
285 'isSelector' =>
true,
289 'foreign_table' =>
'anotherForeignTableName',
291 'foreignTable' =>
'anotherForeignTableName',
293 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'useCombination'] =
true;
294 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'levelLinksPosition'] =
'both';
309 'foreign_table' =>
'aForeignTableName',
311 'showPossibleLocalizationRecords' =>
'1',
319 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'showPossibleLocalizationRecords'] =
true;
334 'foreign_table' =>
'aForeignTableName',
336 'showPossibleLocalizationRecords' => 0,
344 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'showPossibleLocalizationRecords'] =
false;
359 'foreign_table' =>
'aForeignTableName',
361 'showRemovedLocalizationRecords' => 1,
369 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'showRemovedLocalizationRecords'] =
true;
384 'foreign_table' =>
'aForeignTableName',
386 'showRemovedLocalizationRecords' =>
'',
394 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'showRemovedLocalizationRecords'] =
false;
404 'tableName' =>
'aTable',
410 'foreign_table' =>
'aForeignTableName',
411 'foreign_selector' =>
'aField',
412 'foreign_unique' =>
'aDifferentField',
418 $this->expectException(\UnexpectedValueException::class);
419 $this->expectExceptionCode(1444995464);
429 'tableName' =>
'aTable',
435 'foreign_table' =>
'aForeignTableName',
436 'foreign_selector' =>
'aField',
442 $this->expectException(\UnexpectedValueException::class);
443 $this->expectExceptionCode(1444996537);
453 'tableName' =>
'aTable',
459 'foreign_table' =>
'aForeignTableName',
460 'foreign_unique' =>
'aField',
466 $this->expectException(\UnexpectedValueException::class);
467 $this->expectExceptionCode(1444996537);
477 'tableName' =>
'aTable',
483 'foreign_table' =>
'aForeignTableName',
484 'foreign_unique' =>
'aField',
490 $GLOBALS[
'TCA'][
'aForeignTableName'][
'columns'][
'aField'][
'config'] = [
491 'type' =>
'notSelectOrGroup',
493 $this->expectException(\UnexpectedValueException::class);
494 $this->expectExceptionCode(1444996537);
504 'tableName' =>
'aTable',
510 'foreign_table' =>
'aForeignTableName',
511 'foreign_unique' =>
'aField',
517 $GLOBALS[
'TCA'][
'aForeignTableName'][
'columns'][
'aField'][
'config'] = [
519 'internal_type' =>
'notDb'
521 $this->expectException(\UnexpectedValueException::class);
522 $this->expectExceptionCode(1444999130);
532 'tableName' =>
'aTable',
538 'foreign_table' =>
'aForeignTableName',
539 'foreign_unique' =>
'aField',
545 $GLOBALS[
'TCA'][
'aForeignTableName'][
'columns'][
'aField'][
'config'] = [
548 $this->expectException(\UnexpectedValueException::class);
549 $this->expectExceptionCode(1445078627);
559 'tableName' =>
'aTable',
565 'foreign_table' =>
'aForeignTableName',
566 'foreign_unique' =>
'aField',
572 $GLOBALS[
'TCA'][
'aForeignTableName'][
'columns'][
'aField'][
'config'] = [
574 'internal_type' =>
'db',
576 $this->expectException(\UnexpectedValueException::class);
577 $this->expectExceptionCode(1445078628);
592 'foreign_table' =>
'aForeignTableName',
593 'foreign_unique' =>
'aField',
599 $GLOBALS[
'TCA'][
'aForeignTableName'][
'columns'][
'aField'][
'config'] = [
601 'foreign_table' =>
'anotherForeignTableName',
604 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'foreign_unique'] =
'aField';
605 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'selectorOrUniqueConfiguration'] = [
606 'fieldName' =>
'aField',
607 'isSelector' =>
false,
611 'foreign_table' =>
'anotherForeignTableName',
613 'foreignTable' =>
'anotherForeignTableName',
629 'foreign_table' =>
'aForeignTableName',
630 'foreign_selector' =>
'aField',
631 'overrideChildTca' => [
635 'aGivenSetting' =>
'aOverrideValue',
636 'aNewSetting' =>
'aNewSetting',
638 'elementBrowserType' =>
'file',
639 'elementBrowserAllowed' =>
'jpg,png',
650 $GLOBALS[
'TCA'][
'aForeignTableName'][
'columns'][
'aField'][
'config'] = [
652 'internal_type' =>
'db',
653 'allowed' =>
'anotherForeignTableName',
654 'doNotChangeMe' =>
'doNotChangeMe',
655 'aGivenSetting' =>
'aGivenValue',
659 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'appearance'][
'levelLinksPosition'] =
'none';
660 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'foreign_selector'] =
'aField';
661 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'overrideChildTca'][
'columns'][
'aField'] = [
663 'aGivenSetting' =>
'aOverrideValue',
664 'aNewSetting' =>
'aNewSetting',
666 'elementBrowserType' =>
'file',
667 'elementBrowserAllowed' =>
'jpg,png',
672 $expected[
'processedTca'][
'columns'][
'aField'][
'config'][
'selectorOrUniqueConfiguration'] = [
673 'fieldName' =>
'aField',
674 'isSelector' =>
true,
678 'internal_type' =>
'db',
679 'allowed' =>
'anotherForeignTableName',
680 'doNotChangeMe' =>
'doNotChangeMe',
681 'aGivenSetting' =>
'aOverrideValue',
682 'aNewSetting' =>
'aNewSetting',
684 'elementBrowserType' =>
'file',
685 'elementBrowserAllowed' =>
'jpg,png',
688 'foreignTable' =>
'anotherForeignTableName',