TYPO3 CMS  TYPO3_8-7
EvaluateDisplayConditionsTest.php
Go to the documentation of this file.
1 <?php
2 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 
22 
26 class EvaluateDisplayConditionsTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
27 {
32  {
33  $input = [
34  'databaseRow' => [],
35  'processedTca' => [
36  'columns' => [
37  'field_1' => [
38  'displayCond' => [
39  'FOO' => [
40  'condition1',
41  'condition2',
42  ],
43  ],
44  ],
45  ],
46  ],
47  ];
48  $this->expectException(\RuntimeException::class);
49  $this->expectExceptionCode(1481380393);
50  (new EvaluateDisplayConditions())->addData($input);
51  }
52 
57  {
58  $input = [
59  'databaseRow' => [],
60  'processedTca' => [
61  'columns' => [
62  'field_1' => [
63  'displayCond' => [
64  ['condition1'],
65  ],
66  ],
67  ],
68  ],
69  ];
70  $this->expectException(\RuntimeException::class);
71  $this->expectExceptionCode(1481380393);
72  (new EvaluateDisplayConditions())->addData($input);
73  }
74 
79  {
80  $input = [
81  'databaseRow' => [],
82  'processedTca' => [
83  'columns' => [
84  'field_1' => [
85  'displayCond' => [
86  'AND' => [
87  'condition1',
88  ],
89  ],
90  ],
91  ],
92  ],
93  ];
94  $this->expectException(\RuntimeException::class);
95  $this->expectExceptionCode(1481464101);
96  (new EvaluateDisplayConditions())->addData($input);
97  }
98 
103  {
104  $input = [
105  'databaseRow' => [],
106  'processedTca' => [
107  'columns' => [
108  'field_1' => [
109  'displayCond' => false,
110  ],
111  ],
112  ],
113  ];
114  $this->expectException(\RuntimeException::class);
115  $this->expectExceptionCode(1481381058);
116  (new EvaluateDisplayConditions())->addData($input);
117  }
118 
123  {
124  $input = [
125  'databaseRow' => [],
126  'processedTca' => [
127  'columns' => [
128  'field_1' => [
129  'displayCond' => 'foo',
130  ],
131  ],
132  ],
133  ];
134  $this->expectException(\RuntimeException::class);
135  $this->expectExceptionCode(1481381950);
136  (new EvaluateDisplayConditions())->addData($input);
137  }
138 
143  {
144  $input = [
145  'databaseRow' => [],
146  'processedTca' => [
147  'columns' => [
148  'field_1' => [
149  'displayCond' => 'FIELD',
150  ],
151  ],
152  ],
153  ];
154  $this->expectException(\RuntimeException::class);
155  $this->expectExceptionCode(1481385695);
156  (new EvaluateDisplayConditions())->addData($input);
157  }
158 
163  {
164  $input = [
165  'databaseRow' => [],
166  'processedTca' => [
167  'columns' => [
168  'field_1' => [
169  'displayCond' => 'FIELD:fieldName',
170  ],
171  ],
172  ],
173  ];
174  $this->expectException(\RuntimeException::class);
175  $this->expectExceptionCode(1481386239);
176  (new EvaluateDisplayConditions())->addData($input);
177  }
178 
183  {
184  $input = [
185  'databaseRow' => [],
186  'processedTca' => [
187  'columns' => [
188  'field_1' => [
189  'displayCond' => 'FIELD:fieldName:foo',
190  ],
191  ],
192  ],
193  ];
194  $this->expectException(\RuntimeException::class);
195  $this->expectExceptionCode(1481386239);
196  (new EvaluateDisplayConditions())->addData($input);
197  }
198 
203  {
204  $input = [
205  'databaseRow' => [],
206  'processedTca' => [
207  'columns' => [
208  'field_1' => [
209  'displayCond' => 'FIELD:fieldName:REQ',
210  ],
211  ],
212  ],
213  ];
214  $this->expectException(\RuntimeException::class);
215  $this->expectExceptionCode(1481401543);
216  (new EvaluateDisplayConditions())->addData($input);
217  }
218 
223  {
224  $input = [
225  'databaseRow' => [],
226  'processedTca' => [
227  'columns' => [
228  'field_1' => [
229  'displayCond' => 'FIELD:fieldName:REQ:foo',
230  ],
231  ],
232  ],
233  ];
234  $this->expectException(\RuntimeException::class);
235  $this->expectExceptionCode(1481401892);
236  (new EvaluateDisplayConditions())->addData($input);
237  }
238 
243  {
244  $input = [
245  'databaseRow' => [],
246  'processedTca' => [
247  'columns' => [
248  'field_1' => [
249  'displayCond' => 'FIELD:fieldName:>=:foo',
250  ],
251  ],
252  ],
253  ];
254  $this->expectException(\RuntimeException::class);
255  $this->expectExceptionCode(1481456806);
256  (new EvaluateDisplayConditions())->addData($input);
257  }
258 
263  {
264  $input = [
265  'databaseRow' => [],
266  'processedTca' => [
267  'columns' => [
268  'field_1' => [
269  'displayCond' => 'FIELD:fieldName:-:23-',
270  ],
271  ],
272  ],
273  ];
274  $this->expectException(\RuntimeException::class);
275  $this->expectExceptionCode(1481457277);
276  (new EvaluateDisplayConditions())->addData($input);
277  }
278 
283  {
284  $input = [
285  'databaseRow' => [],
286  'processedTca' => [
287  'columns' => [
288  'field_1' => [
289  'displayCond' => 'FIELD:fieldName:-:23-foo',
290  ],
291  ],
292  ],
293  ];
294  $this->expectException(\RuntimeException::class);
295  $this->expectExceptionCode(1481457277);
296  (new EvaluateDisplayConditions())->addData($input);
297  }
298 
303  {
304  $input = [
305  'databaseRow' => [],
306  'processedTca' => [
307  'columns' => [
308  'field_1' => [
309  'displayCond' => 'REC',
310  ],
311  ],
312  ],
313  ];
314  $this->expectException(\RuntimeException::class);
315  $this->expectExceptionCode(1481384784);
316  (new EvaluateDisplayConditions())->addData($input);
317  }
318 
323  {
324  $input = [
325  'databaseRow' => [],
326  'processedTca' => [
327  'columns' => [
328  'field_1' => [
329  'displayCond' => 'REC:foo',
330  ],
331  ],
332  ],
333  ];
334  $this->expectException(\RuntimeException::class);
335  $this->expectExceptionCode(1481384784);
336  (new EvaluateDisplayConditions())->addData($input);
337  }
338 
343  {
344  $input = [
345  'databaseRow' => [],
346  'processedTca' => [
347  'columns' => [
348  'field_1' => [
349  'displayCond' => 'REC:NEW',
350  ],
351  ],
352  ],
353  ];
354  $this->expectException(\RuntimeException::class);
355  $this->expectExceptionCode(1481384947);
356  (new EvaluateDisplayConditions())->addData($input);
357  }
358 
363  {
364  $input = [
365  'databaseRow' => [],
366  'processedTca' => [
367  'columns' => [
368  'field_1' => [
369  'displayCond' => 'REC:NEW:foo',
370  ],
371  ],
372  ],
373  ];
374  $this->expectException(\RuntimeException::class);
375  $this->expectExceptionCode(1481385173);
376  (new EvaluateDisplayConditions())->addData($input);
377  }
378 
383  {
384  $input = [
385  'databaseRow' => [],
386  'processedTca' => [
387  'columns' => [
388  'field_1' => [
389  'displayCond' => 'REC:NEW:false',
390  ],
391  ],
392  ],
393  ];
394  $this->expectException(\RuntimeException::class);
395  $this->expectExceptionCode(1481467208);
396  (new EvaluateDisplayConditions())->addData($input);
397  }
398 
403  {
404  $input = [
405  'databaseRow' => [],
406  'processedTca' => [
407  'columns' => [
408  'field_1' => [
409  'displayCond' => 'VERSION',
410  ],
411  ],
412  ],
413  ];
414  $this->expectException(\RuntimeException::class);
415  $this->expectExceptionCode(1481383660);
416  (new EvaluateDisplayConditions())->addData($input);
417  }
418 
423  {
424  $input = [
425  'databaseRow' => [],
426  'processedTca' => [
427  'columns' => [
428  'field_1' => [
429  'displayCond' => 'VERSION:foo',
430  ],
431  ],
432  ],
433  ];
434  $this->expectException(\RuntimeException::class);
435  $this->expectExceptionCode(1481383660);
436  (new EvaluateDisplayConditions())->addData($input);
437  }
438 
443  {
444  $input = [
445  'databaseRow' => [],
446  'processedTca' => [
447  'columns' => [
448  'field_1' => [
449  'displayCond' => 'VERSION:IS',
450  ],
451  ],
452  ],
453  ];
454  $this->expectException(\RuntimeException::class);
455  $this->expectExceptionCode(1481383888);
456  (new EvaluateDisplayConditions())->addData($input);
457  }
458 
463  {
464  $input = [
465  'databaseRow' => [],
466  'processedTca' => [
467  'columns' => [
468  'field_1' => [
469  'displayCond' => 'VERSION:IS:foo',
470  ],
471  ],
472  ],
473  ];
474  $this->expectException(\RuntimeException::class);
475  $this->expectExceptionCode(1481384123);
476  (new EvaluateDisplayConditions())->addData($input);
477  }
478 
483  {
484  $input = [
485  'databaseRow' => [],
486  'processedTca' => [
487  'columns' => [
488  'field_1' => [
489  'displayCond' => 'VERSION:IS:false',
490  ],
491  ],
492  ],
493  ];
494  $this->expectException(\RuntimeException::class);
495  $this->expectExceptionCode(1481469854);
496  (new EvaluateDisplayConditions())->addData($input);
497  }
498 
503  {
504  $input = [
505  'databaseRow' => [],
506  'processedTca' => [
507  'columns' => [
508  'field_1' => [
509  'displayCond' => 'USER',
510  ],
511  ],
512  ],
513  ];
514  $this->expectException(\RuntimeException::class);
515  $this->expectExceptionCode(1481382954);
516  (new EvaluateDisplayConditions())->addData($input);
517  }
518 
523  {
524  $input = [
525  'databaseRow' => [],
526  'processedTca' => [
527  'columns' => [
528  'field_1' => [
529  'displayCond' => 'USER:' . self::class . '->addDataEvaluatesUserConditionCallback:more:arguments',
530  ],
531  ],
532  ],
533  ];
534  $this->expectException(\RuntimeException::class);
535  $this->expectExceptionCode(1488130499);
536  (new EvaluateDisplayConditions())->addData($input);
537  }
538 
546  public function addDataEvaluatesUserConditionCallback(array $parameter)
547  {
548  $expected = [
549  'record' => [],
550  'flexContext' => [],
551  'flexformValueKey' => 'vDEF',
552  'conditionParameters' => [
553  0 => 'more',
554  1 => 'arguments',
555  ],
556  ];
557  if ($expected === $parameter) {
558  throw new \RuntimeException('testing', 1488130499);
559  }
560  }
561 
566  {
567  $input = [
568  'databaseRow' => [],
569  'processedTca' => [
570  'columns' => [
571  'field_1' => [
572  'displayCond' => 'USER:' . self::class . '->addDataResolvesAllUserParametersCallback:some:more:info',
573  'config' => [
574  'type' => 'input',
575  ],
576  ],
577  ],
578  ],
579  ];
580 
581  $expected = $input;
582  unset($expected['processedTca']['columns']['field_1']['displayCond']);
583 
584  $this->assertSame($expected, (new EvaluateDisplayConditions())->addData($input));
585  }
586 
595  public function addDataResolvesAllUserParametersCallback(array $parameter)
596  {
597  $expected = [
598  0 => 'some',
599  1 => 'more',
600  2 => 'info',
601  ];
602 
603  if ($expected !== $parameter['conditionParameters']) {
604  throw new \RuntimeException('testing', 1538055997);
605  }
606 
607  return true;
608  }
609 
614  {
615  $input = [
616  'databaseRow' => [],
617  'processedTca' => [
618  'columns' => [
619  'field_1' => [
620  'config' => [
621  'type' => 'flex',
622  'ds' => [
623  'sheets' => [
624  'sDEF' => [
625  'ROOT' => [
626  'type' => 'array',
627  'el' => [
628  'foo' => [
629  'displayCond' => 'USER:' . self::class . '->addDataPassesFlexContextToUserConditionCallback:some:info',
630  ],
631  ],
632  ],
633  ],
634  ],
635  ],
636  ],
637  ],
638  ],
639  ],
640  ];
641 
642  $expected = $input;
643  unset($expected['processedTca']['columns']['field_1']['config']['ds']['sheets']['sDEF']['ROOT']['el']['foo']['displayCond']);
644 
645  $this->assertSame($expected, (new EvaluateDisplayConditions())->addData($input));
646  }
647 
656  public function addDataPassesFlexContextToUserConditionCallback(array $parameter)
657  {
658  $expected = [
659  'context' => 'flexField',
660  'sheetNameFieldNames' => [
661  'sDEF.foo' => [
662  'sheetName' => 'sDEF',
663  'fieldName' => 'foo',
664  ],
665  ],
666  'currentSheetName' => 'sDEF',
667  'currentFieldName' => 'foo',
668  'flexFormDataStructure' => [
669  'sheets' => [
670  'sDEF' => [
671  'ROOT' => [
672  'type' => 'array',
673  'el' => [
674  'foo' => [
675  'displayCond' => 'USER:' . self::class . '->addDataPassesFlexContextToUserConditionCallback:some:info'
676  ],
677  ],
678  ],
679  ],
680  ],
681  ],
682  'flexFormRowData' => null,
683  ];
684 
685  if ($expected !== $parameter['flexContext']) {
686  throw new \RuntimeException('testing', 1538057402);
687  }
688 
689  return true;
690  }
691 
696  {
697  $input = [
698  'databaseRow' => [],
699  'processedTca' => [
700  'columns' => [
701  'field_1' => [
702  'config' => [
703  'type' => 'flex',
704  'ds' => [
705  'sheets' => [
706  'sheet' => [
707  'ROOT' => [
708  'el' => [
709  'name.field' => [],
710  ],
711  ],
712  ],
713  'sheet.name' => [
714  'ROOT' => [
715  'el' => [
716  'field' => [],
717  ],
718  ],
719  ],
720  ],
721  ],
722  ],
723  ],
724  ],
725  ],
726  ];
727  $this->expectException(\RuntimeException::class);
728  $this->expectExceptionCode(1481483061);
729  (new EvaluateDisplayConditions())->addData($input);
730  }
731 
736  {
737  $input = [
738  'databaseRow' => [],
739  'processedTca' => [
740  'columns' => [
741  'field_1' => [
742  'config' => [
743  'type' => 'flex',
744  'ds' => [
745  'sheets' => [
746  'aSheet' => [
747  'ROOT' => [
748  'displayCond' => 'FIELD:aSheet.aField:=:foo',
749  'el' => [
750  'aField' => [],
751  ],
752  ],
753  ],
754  ],
755  ],
756  ],
757  ],
758  ],
759  ],
760  ];
761  $this->expectException(\RuntimeException::class);
762  $this->expectExceptionCode(1481485705);
763  (new EvaluateDisplayConditions())->addData($input);
764  }
765 
770  {
771  $input = [
772  'databaseRow' => [],
773  'processedTca' => [
774  'columns' => [
775  'field_1' => [
776  'config' => [
777  'type' => 'flex',
778  'ds' => [
779  'sheets' => [
780  'sheet_1' => [],
781  'sheet_2' => [
782  'ROOT' => [
783  'displayCond' => 'FIELD:sheet_1.flexField_1:!=:foo',
784  ],
785  ],
786  ],
787  ],
788  ],
789  ],
790  ],
791  ],
792  ];
793  $this->expectException(\RuntimeException::class);
794  $this->expectExceptionCode(1481488492);
795  (new EvaluateDisplayConditions())->addData($input);
796  }
797 
802  {
803  $input = [
804  'databaseRow' => [],
805  'processedTca' => [
806  'columns' => [
807  'field_1' => [
808  'config' => [
809  'type' => 'flex',
810  'ds' => [
811  'sheets' => [
812  'sheet_1' => [
813  'ROOT' => [
814  'el' => [
815  'flexField_1' => [],
816  'flexField_2' => [
817  'displayCond' => 'FIELD:flexField_1:!=:foo',
818  ],
819  ],
820  ],
821  ],
822  ],
823  ],
824  ],
825  ],
826  ],
827  ],
828  ];
829  $this->expectException(\RuntimeException::class);
830  $this->expectExceptionCode(1481492953);
831  (new EvaluateDisplayConditions())->addData($input);
832  }
833 
838  {
839  $input = [
840  'databaseRow' => [],
841  'processedTca' => [
842  'columns' => [
843  'field_1' => [
844  'config' => [
845  'type' => 'flex',
846  'ds' => [
847  'sheets' => [
848  'sheet_1' => [
849  'ROOT' => [
850  'el' => [
851  'flexField_1' => [
852  'displayCond' => 'FIELD:foo.flexField_1:!=:foo',
853  ],
854  ],
855  ],
856  ],
857  ],
858  ],
859  ],
860  ],
861  ],
862  ],
863  ];
864  $this->expectException(\RuntimeException::class);
865  $this->expectExceptionCode(1481496170);
866  (new EvaluateDisplayConditions())->addData($input);
867  }
868 
873  {
874  $input = [
875  'databaseRow' => [
876  'field_1' => [
877  'data' => [
878  'sheet_1' => [
879  'lDEF' => [
880  'section_1' => [
881  'el' => [
882  '1' => [
883  'container_1' => [],
884  ],
885  ],
886  ],
887  ],
888  ],
889  ],
890  ],
891  ],
892  'processedTca' => [
893  'columns' => [
894  'field_1' => [
895  'config' => [
896  'type' => 'flex',
897  'ds' => [
898  'sheets' => [
899  'sheet_1' => [
900  'ROOT' => [
901  'el' => [
902  'section_1' => [
903  'type' => 'array',
904  'section' => 1,
905  'children' => [
906  '1' => [
907  'el' => [
908  'containerField_1' => [
909  'displayCond' => 'FIELD:flexField_1:!=:foo',
910  ],
911  ],
912  ],
913  ],
914  ],
915  ],
916  ],
917  ],
918  ],
919  ],
920  ],
921  ],
922  ],
923  ],
924  ];
925  $this->expectException(\RuntimeException::class);
926  $this->expectExceptionCode(1481634649);
927  (new EvaluateDisplayConditions())->addData($input);
928  }
929 
936  {
937  return [
938 
939  // tca field to tca field value tests
940  'remove tca field by tca field value' => [
941  // path that should be removed from 'processedTca' by condition
942  'columns/field_2',
943  // 'databaseRow'
944  [
945  'field_1' => 'foo',
946  ],
947  // 'processedTca'
948  [
949  'columns' => [
950  'field_2' => [
951  'displayCond' => 'FIELD:field_1:!=:foo',
952  ],
953  ],
954  ],
955  ],
956 
957  // flex field to tca field value tests
958  'remove flex form field by tca field value' => [
959  'columns/field_2/config/ds/sheets/sheet_1/ROOT/el/flexField_1',
960  [
961  'field_1' => 'foo',
962  ],
963  [
964  'columns' => [
965  'field_2' => [
966  'config' => [
967  'type' => 'flex',
968  'ds' => [
969  'sheets' => [
970  'sheet_1' => [
971  'ROOT' => [
972  'el' => [
973  'flexField_1' => [
974  'displayCond' => 'FIELD:parentRec.field_1:!=:foo',
975  ],
976  ],
977  ],
978  ],
979  ],
980  ],
981  ],
982  ],
983  ],
984  ],
985  ],
986 
987  // flex field to flex field value on same sheet tests
988  'remove flex form field by flex field value on same flex sheet' => [
989  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/flexField_2',
990  [
991  'field_1' => [
992  'data' => [
993  'sheet_1' => [
994  'lDEF' => [
995  'flexField_1' => [
996  'vDEF' => [
997  0 => 'foo',
998  ],
999  ],
1000  ],
1001  ],
1002  ],
1003  ],
1004  ],
1005  [
1006  'columns' => [
1007  'field_1' => [
1008  'config' => [
1009  'type' => 'flex',
1010  'ds' => [
1011  'sheets' => [
1012  'sheet_1' => [
1013  'ROOT' => [
1014  'el' => [
1015  'flexField_1' => [],
1016  'flexField_2' => [
1017  'displayCond' => 'FIELD:flexField_1:!=:foo',
1018  ],
1019  ],
1020  ],
1021  ],
1022  ],
1023  ],
1024  ],
1025  ],
1026  ],
1027  ],
1028  ],
1029 
1030  'remove flex form field by flex field value on same flex sheet with dot in flex sheet name' => [
1031  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/flexField_2',
1032  [
1033  'field_1' => [
1034  'data' => [
1035  'sheet.1' => [
1036  'lDEF' => [
1037  'flexField_1' => [
1038  'vDEF' => [
1039  0 => 'foo',
1040  ],
1041  ],
1042  ],
1043  ],
1044  ],
1045  ],
1046  ],
1047  [
1048  'columns' => [
1049  'field_1' => [
1050  'config' => [
1051  'type' => 'flex',
1052  'ds' => [
1053  'sheets' => [
1054  'sheet.1' => [
1055  'ROOT' => [
1056  'el' => [
1057  'flexField_1' => [],
1058  'flexField_2' => [
1059  'displayCond' => 'FIELD:flexField_1:!=:foo',
1060  ],
1061  ],
1062  ],
1063  ],
1064  ],
1065  ],
1066  ],
1067  ],
1068  ],
1069  ],
1070  ],
1071 
1072  'remove flex form field by flex field value on same flex sheet with dot in flex field name' => [
1073  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/flexField_2',
1074  [
1075  'field_1' => [
1076  'data' => [
1077  'sheet_1' => [
1078  'lDEF' => [
1079  'flexField.1' => [
1080  'vDEF' => [
1081  0 => 'foo',
1082  ],
1083  ],
1084  ],
1085  ],
1086  ],
1087  ],
1088  ],
1089  [
1090  'columns' => [
1091  'field_1' => [
1092  'config' => [
1093  'type' => 'flex',
1094  'ds' => [
1095  'sheets' => [
1096  'sheet_1' => [
1097  'ROOT' => [
1098  'el' => [
1099  'flexField.1' => [],
1100  'flexField_2' => [
1101  'displayCond' => 'FIELD:flexField.1:!=:foo',
1102  ],
1103  ],
1104  ],
1105  ],
1106  ],
1107  ],
1108  ],
1109  ],
1110  ],
1111  ],
1112  ],
1113 
1114  'remove flex form field by flex field value on same flex sheet with dot in flex sheet name and dot in flex field name' => [
1115  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/flexField_2',
1116  [
1117  'field_1' => [
1118  'data' => [
1119  'sheet.1' => [
1120  'lDEF' => [
1121  'flexField.1' => [
1122  'vDEF' => [
1123  0 => 'foo',
1124  ],
1125  ],
1126  ],
1127  ],
1128  ],
1129  ],
1130  ],
1131  [
1132  'columns' => [
1133  'field_1' => [
1134  'config' => [
1135  'type' => 'flex',
1136  'ds' => [
1137  'sheets' => [
1138  'sheet.1' => [
1139  'ROOT' => [
1140  'el' => [
1141  'flexField.1' => [],
1142  'flexField_2' => [
1143  'displayCond' => 'FIELD:flexField.1:!=:foo',
1144  ],
1145  ],
1146  ],
1147  ],
1148  ],
1149  ],
1150  ],
1151  ],
1152  ],
1153  ],
1154  ],
1155 
1156  'remove flex form field by flex field value on same flex sheet with specified flex sheet name' => [
1157  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/flexField_2',
1158  [
1159  'field_1' => [
1160  'data' => [
1161  'sheet_1' => [
1162  'lDEF' => [
1163  'flexField_1' => [
1164  'vDEF' => [
1165  0 => 'foo',
1166  ],
1167  ],
1168  ],
1169  ],
1170  ],
1171  ],
1172  ],
1173  [
1174  'columns' => [
1175  'field_1' => [
1176  'config' => [
1177  'type' => 'flex',
1178  'ds' => [
1179  'sheets' => [
1180  'sheet_1' => [
1181  'ROOT' => [
1182  'el' => [
1183  'flexField_1' => [],
1184  'flexField_2' => [
1185  'displayCond' => 'FIELD:sheet_1.flexField_1:!=:foo',
1186  ],
1187  ],
1188  ],
1189  ],
1190  ],
1191  ],
1192  ],
1193  ],
1194  ],
1195  ],
1196  ],
1197 
1198  'remove flex form field by flex field value on same flex sheet with specified flex sheet name with dot in flex sheet name' => [
1199  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/flexField_2',
1200  [
1201  'field_1' => [
1202  'data' => [
1203  'sheet.1' => [
1204  'lDEF' => [
1205  'flexField_1' => [
1206  'vDEF' => [
1207  0 => 'foo',
1208  ],
1209  ],
1210  ],
1211  ],
1212  ],
1213  ],
1214  ],
1215  [
1216  'columns' => [
1217  'field_1' => [
1218  'config' => [
1219  'type' => 'flex',
1220  'ds' => [
1221  'sheets' => [
1222  'sheet.1' => [
1223  'ROOT' => [
1224  'el' => [
1225  'flexField_1' => [],
1226  'flexField_2' => [
1227  'displayCond' => 'FIELD:sheet.1.flexField_1:!=:foo',
1228  ],
1229  ],
1230  ],
1231  ],
1232  ],
1233  ],
1234  ],
1235  ],
1236  ],
1237  ],
1238  ],
1239 
1240  'remove flex form field by flex field value on same flex sheet with specified flex sheet name with dot in flex field name' => [
1241  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/flexField_2',
1242  [
1243  'field_1' => [
1244  'data' => [
1245  'sheet_1' => [
1246  'lDEF' => [
1247  'flexField.1' => [
1248  'vDEF' => [
1249  0 => 'foo',
1250  ],
1251  ],
1252  ],
1253  ],
1254  ],
1255  ],
1256  ],
1257  [
1258  'columns' => [
1259  'field_1' => [
1260  'config' => [
1261  'type' => 'flex',
1262  'ds' => [
1263  'sheets' => [
1264  'sheet_1' => [
1265  'ROOT' => [
1266  'el' => [
1267  'flexField.1' => [],
1268  'flexField_2' => [
1269  'displayCond' => 'FIELD:sheet_1.flexField.1:!=:foo',
1270  ],
1271  ],
1272  ],
1273  ],
1274  ],
1275  ],
1276  ],
1277  ],
1278  ],
1279  ],
1280  ],
1281 
1282  'remove flex form field by flex field value on same flex sheet with specified flex sheet name with dot in flex sheet name and dot in flex field name' => [
1283  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/flexField_2',
1284  [
1285  'field_1' => [
1286  'data' => [
1287  'sheet.1' => [
1288  'lDEF' => [
1289  'flexField.1' => [
1290  'vDEF' => [
1291  0 => 'foo',
1292  ],
1293  ],
1294  ],
1295  ],
1296  ],
1297  ],
1298  ],
1299  [
1300  'columns' => [
1301  'field_1' => [
1302  'config' => [
1303  'type' => 'flex',
1304  'ds' => [
1305  'sheets' => [
1306  'sheet.1' => [
1307  'ROOT' => [
1308  'el' => [
1309  'flexField.1' => [],
1310  'flexField_2' => [
1311  'displayCond' => 'FIELD:sheet.1.flexField.1:!=:foo',
1312  ],
1313  ],
1314  ],
1315  ],
1316  ],
1317  ],
1318  ],
1319  ],
1320  ],
1321  ],
1322  ],
1323 
1324  // flex field to flex field value on other sheet tests
1325  'remove flex form field by flex field value on other flex sheet' => [
1326  'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/flexField_1',
1327  [
1328  'field_1' => [
1329  'data' => [
1330  'sheet_1' => [
1331  'lDEF' => [
1332  'flexField_1' => [
1333  'vDEF' => [
1334  0 => 'foo',
1335  ],
1336  ],
1337  ],
1338  ],
1339  ],
1340  ],
1341  ],
1342  [
1343  'columns' => [
1344  'field_1' => [
1345  'config' => [
1346  'type' => 'flex',
1347  'ds' => [
1348  'sheets' => [
1349  'sheet_1' => [
1350  'ROOT' => [
1351  'el' => [
1352  'flexField_1' => [],
1353  ],
1354  ],
1355  ],
1356  'sheet_2' => [
1357  'ROOT' => [
1358  'el' => [
1359  'flexField_1' => [
1360  'displayCond' => 'FIELD:sheet_1.flexField_1:!=:foo',
1361  ],
1362  ],
1363  ],
1364  ],
1365  ],
1366  ],
1367  ],
1368  ],
1369  ],
1370  ],
1371  ],
1372 
1373  'remove flex form field by flex field value on other flex sheet with dot in flex sheet name' => [
1374  'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/flexField_1',
1375  [
1376  'field_1' => [
1377  'data' => [
1378  'sheet.1' => [
1379  'lDEF' => [
1380  'flexField_1' => [
1381  'vDEF' => [
1382  0 => 'foo',
1383  ],
1384  ],
1385  ],
1386  ],
1387  ],
1388  ],
1389  ],
1390  [
1391  'columns' => [
1392  'field_1' => [
1393  'config' => [
1394  'type' => 'flex',
1395  'ds' => [
1396  'sheets' => [
1397  'sheet.1' => [
1398  'ROOT' => [
1399  'el' => [
1400  'flexField_1' => [],
1401  ],
1402  ],
1403  ],
1404  'sheet_2' => [
1405  'ROOT' => [
1406  'el' => [
1407  'flexField_1' => [
1408  'displayCond' => 'FIELD:sheet.1.flexField_1:!=:foo',
1409  ],
1410  ],
1411  ],
1412  ],
1413  ],
1414  ],
1415  ],
1416  ],
1417  ],
1418  ],
1419  ],
1420 
1421  'remove flex form field by flex field value on other flex sheet with dot in flex field name' => [
1422  'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/flexField_1',
1423  [
1424  'field_1' => [
1425  'data' => [
1426  'sheet_1' => [
1427  'lDEF' => [
1428  'flexField.1' => [
1429  'vDEF' => [
1430  0 => 'foo',
1431  ],
1432  ],
1433  ],
1434  ],
1435  ],
1436  ],
1437  ],
1438  [
1439  'columns' => [
1440  'field_1' => [
1441  'config' => [
1442  'type' => 'flex',
1443  'ds' => [
1444  'sheets' => [
1445  'sheet_1' => [
1446  'ROOT' => [
1447  'el' => [
1448  'flexField.1' => [],
1449  ],
1450  ],
1451  ],
1452  'sheet_2' => [
1453  'ROOT' => [
1454  'el' => [
1455  'flexField_1' => [
1456  'displayCond' => 'FIELD:sheet_1.flexField.1:!=:foo',
1457  ],
1458  ],
1459  ],
1460  ],
1461  ],
1462  ],
1463  ],
1464  ],
1465  ],
1466  ],
1467  ],
1468 
1469  'remove flex form field by flex field value on other flex sheet with dot in flex sheet name and dot in flex field name' => [
1470  'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/flexField_1',
1471  [
1472  'field_1' => [
1473  'data' => [
1474  'sheet.1' => [
1475  'lDEF' => [
1476  'flexField.1' => [
1477  'vDEF' => [
1478  0 => 'foo',
1479  ],
1480  ],
1481  ],
1482  ],
1483  ],
1484  ],
1485  ],
1486  [
1487  'columns' => [
1488  'field_1' => [
1489  'config' => [
1490  'type' => 'flex',
1491  'ds' => [
1492  'sheets' => [
1493  'sheet.1' => [
1494  'ROOT' => [
1495  'el' => [
1496  'flexField.1' => [],
1497  ],
1498  ],
1499  ],
1500  'sheet_2' => [
1501  'ROOT' => [
1502  'el' => [
1503  'flexField_1' => [
1504  'displayCond' => 'FIELD:sheet.1.flexField.1:!=:foo',
1505  ],
1506  ],
1507  ],
1508  ],
1509  ],
1510  ],
1511  ],
1512  ],
1513  ],
1514  ],
1515  ],
1516 
1517  // flex sheet to tca field value tests
1518  'remove flex form sheet by tca field value' => [
1519  'columns/field_2/config/ds/sheets/sheet_1',
1520  [
1521  'field_1' => 'foo',
1522  ],
1523  [
1524  'columns' => [
1525  'field_2' => [
1526  'config' => [
1527  'type' => 'flex',
1528  'ds' => [
1529  'sheets' => [
1530  'sheet_1' => [
1531  'ROOT' => [
1532  'displayCond' => 'FIELD:parentRec.field_1:!=:foo',
1533  ],
1534  ],
1535  ],
1536  ],
1537  ],
1538  ],
1539  ],
1540  ],
1541  ],
1542 
1543  // flex sheet to flex field value tests
1544  'remove flex form sheet by flex field value on different flex sheet' => [
1545  'columns/field_1/config/ds/sheets/sheet_2',
1546  [
1547  'field_1' => [
1548  'data' => [
1549  'sheet_1' => [
1550  'lDEF' => [
1551  'flexField_1' => [
1552  'vDEF' => [
1553  0 => 'foo',
1554  ],
1555  ],
1556  ],
1557  ],
1558  ],
1559  ],
1560  ],
1561  [
1562  'columns' => [
1563  'field_1' => [
1564  'config' => [
1565  'type' => 'flex',
1566  'ds' => [
1567  'sheets' => [
1568  'sheet_1' => [
1569  'ROOT' => [
1570  'el' => [
1571  'flexField_1' => [],
1572  ],
1573  ],
1574  ],
1575  'sheet_2' => [
1576  'ROOT' => [
1577  'displayCond' => 'FIELD:sheet_1.flexField_1:!=:foo',
1578  ],
1579  ],
1580  ],
1581  ],
1582  ],
1583  ],
1584  ],
1585  ],
1586  ],
1587 
1588  'remove flex form sheet by flex field value on different flex sheet with dot in flex sheet name' => [
1589  'columns/field_1/config/ds/sheets/sheet.2',
1590  [
1591  'field_1' => [
1592  'data' => [
1593  'sheet.1' => [
1594  'lDEF' => [
1595  'flexField_1' => [
1596  'vDEF' => [
1597  0 => 'foo',
1598  ],
1599  ],
1600  ],
1601  ],
1602  ],
1603  ],
1604  ],
1605  [
1606  'columns' => [
1607  'field_1' => [
1608  'config' => [
1609  'type' => 'flex',
1610  'ds' => [
1611  'sheets' => [
1612  'sheet.1' => [
1613  'ROOT' => [
1614  'el' => [
1615  'flexField_1' => [],
1616  ],
1617  ],
1618  ],
1619  'sheet.2' => [
1620  'ROOT' => [
1621  'displayCond' => 'FIELD:sheet.1.flexField_1:!=:foo',
1622  ],
1623  ],
1624  ],
1625  ],
1626  ],
1627  ],
1628  ],
1629  ],
1630  ],
1631 
1632  'remove flex form sheet by flex field value on different flex sheet with dot in flex field name' => [
1633  'columns/field_1/config/ds/sheets/sheet_2',
1634  [
1635  'field_1' => [
1636  'data' => [
1637  'sheet_1' => [
1638  'lDEF' => [
1639  'flexField.1' => [
1640  'vDEF' => [
1641  0 => 'foo',
1642  ],
1643  ],
1644  ],
1645  ],
1646  ],
1647  ],
1648  ],
1649  [
1650  'columns' => [
1651  'field_1' => [
1652  'config' => [
1653  'type' => 'flex',
1654  'ds' => [
1655  'sheets' => [
1656  'sheet_1' => [
1657  'ROOT' => [
1658  'el' => [
1659  'flexField.1' => [],
1660  ],
1661  ],
1662  ],
1663  'sheet_2' => [
1664  'ROOT' => [
1665  'displayCond' => 'FIELD:sheet_1.flexField.1:!=:foo',
1666  ],
1667  ],
1668  ],
1669  ],
1670  ],
1671  ],
1672  ],
1673  ],
1674  ],
1675 
1676  'remove flex form sheet by flex field value on different flex sheet with dot in flex sheet name and dot in flex field name' => [
1677  'columns/field_1/config/ds/sheets/sheet.2',
1678  [
1679  'field_1' => [
1680  'data' => [
1681  'sheet.1' => [
1682  'lDEF' => [
1683  'flexField.1' => [
1684  'vDEF' => [
1685  0 => 'foo',
1686  ],
1687  ],
1688  ],
1689  ],
1690  ],
1691  ],
1692  ],
1693  [
1694  'columns' => [
1695  'field_1' => [
1696  'config' => [
1697  'type' => 'flex',
1698  'ds' => [
1699  'sheets' => [
1700  'sheet.1' => [
1701  'ROOT' => [
1702  'el' => [
1703  'flexField.1' => [],
1704  ],
1705  ],
1706  ],
1707  'sheet.2' => [
1708  'ROOT' => [
1709  'displayCond' => 'FIELD:sheet.1.flexField.1:!=:foo',
1710  ],
1711  ],
1712  ],
1713  ],
1714  ],
1715  ],
1716  ],
1717  ],
1718  ],
1719 
1720  // flex section container field to tca value tests
1721  'remove flex section container field by tca field value' => [
1722  'columns/field_2/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
1723  [
1724  'field_1' => 'foo',
1725  'field_2' => [
1726  'data' => [
1727  'sheet_1' => [
1728  'lDEF' => [
1729  'section_1' => [
1730  'el' => [
1731  '1' => [],
1732  ],
1733  ],
1734  ],
1735  ],
1736  ],
1737  ],
1738  ],
1739  [
1740  'columns' => [
1741  'field_2' => [
1742  'config' => [
1743  'type' => 'flex',
1744  'ds' => [
1745  'sheets' => [
1746  'sheet_1' => [
1747  'ROOT' => [
1748  'el' => [
1749  'section_1' => [
1750  'type' => 'array',
1751  'section' => 1,
1752  'children' => [
1753  '1' => [
1754  'el' => [
1755  'containerField_1' => [
1756  'displayCond' => 'FIELD:parentRec.field_1:!=:foo',
1757  ],
1758  ],
1759  ],
1760  ],
1761  ],
1762  ],
1763  ],
1764  ],
1765  ],
1766  ],
1767  ],
1768  ],
1769  ],
1770  ],
1771  ],
1772 
1773  // flex section container field to flex field value of same sheet
1774  'remove flex section container field by flex field value on same flex sheet' => [
1775  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
1776  [
1777  'field_1' => [
1778  'data' => [
1779  'sheet_1' => [
1780  'lDEF' => [
1781  'flexField_1' => [
1782  'vDEF' => [
1783  0 => 'foo',
1784  ],
1785  ],
1786  'section_1' => [
1787  'el' => [
1788  '1' => [],
1789  ],
1790  ],
1791  ],
1792  ],
1793  ],
1794  ],
1795  ],
1796  [
1797  'columns' => [
1798  'field_1' => [
1799  'config' => [
1800  'type' => 'flex',
1801  'ds' => [
1802  'sheets' => [
1803  'sheet_1' => [
1804  'ROOT' => [
1805  'el' => [
1806  'flexField_1' => [],
1807  'section_1' => [
1808  'type' => 'array',
1809  'section' => 1,
1810  'children' => [
1811  '1' => [
1812  'el' => [
1813  'containerField_1' => [
1814  'displayCond' => 'FIELD:flexField_1:!=:foo',
1815  ],
1816  ],
1817  ],
1818  ],
1819  ],
1820  ],
1821  ],
1822  ],
1823  ],
1824  ],
1825  ],
1826  ],
1827  ],
1828  ],
1829  ],
1830 
1831  'remove flex section container field by flex field value on same flex sheet with dot in flex sheet name' => [
1832  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_1',
1833  [
1834  'field_1' => [
1835  'data' => [
1836  'sheet.1' => [
1837  'lDEF' => [
1838  'flexField_1' => [
1839  'vDEF' => [
1840  0 => 'foo',
1841  ],
1842  ],
1843  'section_1' => [
1844  'el' => [
1845  '1' => [],
1846  ],
1847  ],
1848  ],
1849  ],
1850  ],
1851  ],
1852  ],
1853  [
1854  'columns' => [
1855  'field_1' => [
1856  'config' => [
1857  'type' => 'flex',
1858  'ds' => [
1859  'sheets' => [
1860  'sheet.1' => [
1861  'ROOT' => [
1862  'el' => [
1863  'flexField_1' => [],
1864  'section_1' => [
1865  'type' => 'array',
1866  'section' => 1,
1867  'children' => [
1868  '1' => [
1869  'el' => [
1870  'containerField_1' => [
1871  'displayCond' => 'FIELD:flexField_1:!=:foo',
1872  ],
1873  ],
1874  ],
1875  ],
1876  ],
1877  ],
1878  ],
1879  ],
1880  ],
1881  ],
1882  ],
1883  ],
1884  ],
1885  ],
1886  ],
1887 
1888  'remove flex section container field by flex field value on same flex sheet with dot in flex field name' => [
1889  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
1890  [
1891  'field_1' => [
1892  'data' => [
1893  'sheet_1' => [
1894  'lDEF' => [
1895  'flexField.1' => [
1896  'vDEF' => [
1897  0 => 'foo',
1898  ],
1899  ],
1900  'section_1' => [
1901  'el' => [
1902  '1' => [],
1903  ],
1904  ],
1905  ],
1906  ],
1907  ],
1908  ],
1909  ],
1910  [
1911  'columns' => [
1912  'field_1' => [
1913  'config' => [
1914  'type' => 'flex',
1915  'ds' => [
1916  'sheets' => [
1917  'sheet_1' => [
1918  'ROOT' => [
1919  'el' => [
1920  'flexField.1' => [],
1921  'section_1' => [
1922  'type' => 'array',
1923  'section' => 1,
1924  'children' => [
1925  '1' => [
1926  'el' => [
1927  'containerField_1' => [
1928  'displayCond' => 'FIELD:flexField.1:!=:foo',
1929  ],
1930  ],
1931  ],
1932  ],
1933  ],
1934  ],
1935  ],
1936  ],
1937  ],
1938  ],
1939  ],
1940  ],
1941  ],
1942  ],
1943  ],
1944 
1945  'remove flex section container field by flex field value on same flex sheet with dot in flex sheet name and dot in flex field name' => [
1946  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_1',
1947  [
1948  'field_1' => [
1949  'data' => [
1950  'sheet.1' => [
1951  'lDEF' => [
1952  'flexField.1' => [
1953  'vDEF' => [
1954  0 => 'foo',
1955  ],
1956  ],
1957  'section_1' => [
1958  'el' => [
1959  '1' => [],
1960  ],
1961  ],
1962  ],
1963  ],
1964  ],
1965  ],
1966  ],
1967  [
1968  'columns' => [
1969  'field_1' => [
1970  'config' => [
1971  'type' => 'flex',
1972  'ds' => [
1973  'sheets' => [
1974  'sheet.1' => [
1975  'ROOT' => [
1976  'el' => [
1977  'flexField.1' => [],
1978  'section_1' => [
1979  'type' => 'array',
1980  'section' => 1,
1981  'children' => [
1982  '1' => [
1983  'el' => [
1984  'containerField_1' => [
1985  'displayCond' => 'FIELD:flexField.1:!=:foo',
1986  ],
1987  ],
1988  ],
1989  ],
1990  ],
1991  ],
1992  ],
1993  ],
1994  ],
1995  ],
1996  ],
1997  ],
1998  ],
1999  ],
2000  ],
2001 
2002  'remove flex section container field by flex field value on same flex sheet with specified flex sheet name' => [
2003  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
2004  [
2005  'field_1' => [
2006  'data' => [
2007  'sheet_1' => [
2008  'lDEF' => [
2009  'flexField_1' => [
2010  'vDEF' => [
2011  0 => 'foo',
2012  ],
2013  ],
2014  'section_1' => [
2015  'el' => [
2016  '1' => [],
2017  ],
2018  ],
2019  ],
2020  ],
2021  ],
2022  ],
2023  ],
2024  [
2025  'columns' => [
2026  'field_1' => [
2027  'config' => [
2028  'type' => 'flex',
2029  'ds' => [
2030  'sheets' => [
2031  'sheet_1' => [
2032  'ROOT' => [
2033  'el' => [
2034  'flexField_1' => [],
2035  'section_1' => [
2036  'type' => 'array',
2037  'section' => 1,
2038  'children' => [
2039  '1' => [
2040  'el' => [
2041  'containerField_1' => [
2042  'displayCond' => 'FIELD:sheet_1.flexField_1:!=:foo',
2043  ],
2044  ],
2045  ],
2046  ],
2047  ],
2048  ],
2049  ],
2050  ],
2051  ],
2052  ],
2053  ],
2054  ],
2055  ],
2056  ],
2057  ],
2058 
2059  'remove flex section container field by flex field value on same flex sheet with specified flex sheet name with dot in flex sheet name' => [
2060  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_1',
2061  [
2062  'field_1' => [
2063  'data' => [
2064  'sheet.1' => [
2065  'lDEF' => [
2066  'flexField_1' => [
2067  'vDEF' => [
2068  0 => 'foo',
2069  ],
2070  ],
2071  'section_1' => [
2072  'el' => [
2073  '1' => [],
2074  ],
2075  ],
2076  ],
2077  ],
2078  ],
2079  ],
2080  ],
2081  [
2082  'columns' => [
2083  'field_1' => [
2084  'config' => [
2085  'type' => 'flex',
2086  'ds' => [
2087  'sheets' => [
2088  'sheet.1' => [
2089  'ROOT' => [
2090  'el' => [
2091  'flexField_1' => [],
2092  'section_1' => [
2093  'type' => 'array',
2094  'section' => 1,
2095  'children' => [
2096  '1' => [
2097  'el' => [
2098  'containerField_1' => [
2099  'displayCond' => 'FIELD:sheet.1.flexField_1:!=:foo',
2100  ],
2101  ],
2102  ],
2103  ],
2104  ],
2105  ],
2106  ],
2107  ],
2108  ],
2109  ],
2110  ],
2111  ],
2112  ],
2113  ],
2114  ],
2115 
2116  'remove flex section container field by flex field value on same flex sheet with specified flex sheet name with dot in flex field name' => [
2117  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
2118  [
2119  'field_1' => [
2120  'data' => [
2121  'sheet_1' => [
2122  'lDEF' => [
2123  'flexField.1' => [
2124  'vDEF' => [
2125  0 => 'foo',
2126  ],
2127  ],
2128  'section_1' => [
2129  'el' => [
2130  '1' => [],
2131  ],
2132  ],
2133  ],
2134  ],
2135  ],
2136  ],
2137  ],
2138  [
2139  'columns' => [
2140  'field_1' => [
2141  'config' => [
2142  'type' => 'flex',
2143  'ds' => [
2144  'sheets' => [
2145  'sheet_1' => [
2146  'ROOT' => [
2147  'el' => [
2148  'flexField.1' => [],
2149  'section_1' => [
2150  'type' => 'array',
2151  'section' => 1,
2152  'children' => [
2153  '1' => [
2154  'el' => [
2155  'containerField_1' => [
2156  'displayCond' => 'FIELD:sheet_1.flexField.1:!=:foo',
2157  ],
2158  ],
2159  ],
2160  ],
2161  ],
2162  ],
2163  ],
2164  ],
2165  ],
2166  ],
2167  ],
2168  ],
2169  ],
2170  ],
2171  ],
2172 
2173  'remove flex section container field by flex field value on same flex sheet with specified flex sheet name with dot in flex sheet name and dot in flex field name' => [
2174  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_1',
2175  [
2176  'field_1' => [
2177  'data' => [
2178  'sheet.1' => [
2179  'lDEF' => [
2180  'flexField.1' => [
2181  'vDEF' => [
2182  0 => 'foo',
2183  ],
2184  ],
2185  'section_1' => [
2186  'el' => [
2187  '1' => [],
2188  ],
2189  ],
2190  ],
2191  ],
2192  ],
2193  ],
2194  ],
2195  [
2196  'columns' => [
2197  'field_1' => [
2198  'config' => [
2199  'type' => 'flex',
2200  'ds' => [
2201  'sheets' => [
2202  'sheet.1' => [
2203  'ROOT' => [
2204  'el' => [
2205  'flexField.1' => [],
2206  'section_1' => [
2207  'type' => 'array',
2208  'section' => 1,
2209  'children' => [
2210  '1' => [
2211  'el' => [
2212  'containerField_1' => [
2213  'displayCond' => 'FIELD:sheet.1.flexField.1:!=:foo',
2214  ],
2215  ],
2216  ],
2217  ],
2218  ],
2219  ],
2220  ],
2221  ],
2222  ],
2223  ],
2224  ],
2225  ],
2226  ],
2227  ],
2228  ],
2229 
2230  // flex section container field to flex field value of other sheet
2231  'remove flex section container field by flex field value on other flex sheet' => [
2232  'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/section_1/children/1/el/containerField_1',
2233  [
2234  'field_1' => [
2235  'data' => [
2236  'sheet_1' => [
2237  'lDEF' => [
2238  'flexField_1' => [
2239  'vDEF' => [
2240  0 => 'foo',
2241  ],
2242  ],
2243  ],
2244  ],
2245  'sheet_2' => [
2246  'lDEF' => [
2247  'section_1' => [
2248  'el' => [
2249  '1' => [],
2250  ],
2251  ],
2252  ],
2253  ],
2254  ],
2255  ],
2256  ],
2257  [
2258  'columns' => [
2259  'field_1' => [
2260  'config' => [
2261  'type' => 'flex',
2262  'ds' => [
2263  'sheets' => [
2264  'sheet_1' => [
2265  'ROOT' => [
2266  'el' => [
2267  'flexField_1' => [],
2268  ],
2269  ],
2270  ],
2271  'sheet_2' => [
2272  'ROOT' => [
2273  'el' => [
2274  'section_1' => [
2275  'type' => 'array',
2276  'section' => 1,
2277  'children' => [
2278  '1' => [
2279  'el' => [
2280  'containerField_1' => [
2281  'displayCond' => 'FIELD:sheet_1.flexField_1:!=:foo',
2282  ],
2283  ],
2284  ],
2285  ],
2286  ],
2287  ],
2288  ],
2289  ],
2290  ],
2291  ],
2292  ],
2293  ],
2294  ],
2295  ],
2296  ],
2297 
2298  'remove flex section container field by flex field value on other flex sheet with dot in flex sheet name' => [
2299  'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/section_1/children/1/el/containerField_1',
2300  [
2301  'field_1' => [
2302  'data' => [
2303  'sheet.1' => [
2304  'lDEF' => [
2305  'flexField_1' => [
2306  'vDEF' => [
2307  0 => 'foo',
2308  ],
2309  ],
2310  ],
2311  ],
2312  'sheet_2' => [
2313  'lDEF' => [
2314  'section_1' => [
2315  'el' => [
2316  '1' => [],
2317  ],
2318  ],
2319  ],
2320  ],
2321  ],
2322  ],
2323  ],
2324  [
2325  'columns' => [
2326  'field_1' => [
2327  'config' => [
2328  'type' => 'flex',
2329  'ds' => [
2330  'sheets' => [
2331  'sheet.1' => [
2332  'ROOT' => [
2333  'el' => [
2334  'flexField_1' => [],
2335  ],
2336  ],
2337  ],
2338  'sheet_2' => [
2339  'ROOT' => [
2340  'el' => [
2341  'section_1' => [
2342  'type' => 'array',
2343  'section' => 1,
2344  'children' => [
2345  '1' => [
2346  'el' => [
2347  'containerField_1' => [
2348  'displayCond' => 'FIELD:sheet.1.flexField_1:!=:foo',
2349  ],
2350  ],
2351  ],
2352  ],
2353  ],
2354  ],
2355  ],
2356  ],
2357  ],
2358  ],
2359  ],
2360  ],
2361  ],
2362  ],
2363  ],
2364 
2365  'remove flex section container field by flex field value on other flex sheet with dot in flex field name' => [
2366  'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/section_1/children/1/el/containerField_1',
2367  [
2368  'field_1' => [
2369  'data' => [
2370  'sheet_1' => [
2371  'lDEF' => [
2372  'flexField.1' => [
2373  'vDEF' => [
2374  0 => 'foo',
2375  ],
2376  ],
2377  ],
2378  ],
2379  'sheet_2' => [
2380  'lDEF' => [
2381  'section_1' => [
2382  'el' => [
2383  '1' => [],
2384  ],
2385  ],
2386  ],
2387  ],
2388  ],
2389  ],
2390  ],
2391  [
2392  'columns' => [
2393  'field_1' => [
2394  'config' => [
2395  'type' => 'flex',
2396  'ds' => [
2397  'sheets' => [
2398  'sheet_1' => [
2399  'ROOT' => [
2400  'el' => [
2401  'flexField.1' => [],
2402  ],
2403  ],
2404  ],
2405  'sheet_2' => [
2406  'ROOT' => [
2407  'el' => [
2408  'section_1' => [
2409  'type' => 'array',
2410  'section' => 1,
2411  'children' => [
2412  '1' => [
2413  'el' => [
2414  'containerField_1' => [
2415  'displayCond' => 'FIELD:sheet_1.flexField.1:!=:foo',
2416  ],
2417  ],
2418  ],
2419  ],
2420  ],
2421  ],
2422  ],
2423  ],
2424  ],
2425  ],
2426  ],
2427  ],
2428  ],
2429  ],
2430  ],
2431 
2432  'remove flex section container field by flex field value on other flex sheet with dot in flex sheet name and dot in flex field name' => [
2433  'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/section_1/children/1/el/containerField_1',
2434  [
2435  'field_1' => [
2436  'data' => [
2437  'sheet.1' => [
2438  'lDEF' => [
2439  'flexField.1' => [
2440  'vDEF' => [
2441  0 => 'foo',
2442  ],
2443  ],
2444  ],
2445  ],
2446  'sheet_2' => [
2447  'lDEF' => [
2448  'section_1' => [
2449  'el' => [
2450  '1' => [],
2451  ],
2452  ],
2453  ],
2454  ],
2455  ],
2456  ],
2457  ],
2458  [
2459  'columns' => [
2460  'field_1' => [
2461  'config' => [
2462  'type' => 'flex',
2463  'ds' => [
2464  'sheets' => [
2465  'sheet.1' => [
2466  'ROOT' => [
2467  'el' => [
2468  'flexField.1' => [],
2469  ],
2470  ],
2471  ],
2472  'sheet_2' => [
2473  'ROOT' => [
2474  'el' => [
2475  'section_1' => [
2476  'type' => 'array',
2477  'section' => 1,
2478  'children' => [
2479  '1' => [
2480  'el' => [
2481  'containerField_1' => [
2482  'displayCond' => 'FIELD:sheet.1.flexField.1:!=:foo',
2483  ],
2484  ],
2485  ],
2486  ],
2487  ],
2488  ],
2489  ],
2490  ],
2491  ],
2492  ],
2493  ],
2494  ],
2495  ],
2496  ],
2497  ],
2498 
2499  // flex section container field to flex field value of same container
2500  'remove flex section container field by flex container field value of same container' => [
2501  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_2',
2502  [
2503  'field_1' => [
2504  'data' => [
2505  'sheet_1' => [
2506  'lDEF' => [
2507  'section_1' => [
2508  'el' => [
2509  '1' => [
2510  'container_1' => [
2511  'el' => [
2512  'containerField_1' => [
2513  'vDEF' => 'foo',
2514  ],
2515  ],
2516  ],
2517  ],
2518  ],
2519  ],
2520  ],
2521  ],
2522  ],
2523  ],
2524  ],
2525  [
2526  'columns' => [
2527  'field_1' => [
2528  'config' => [
2529  'type' => 'flex',
2530  'ds' => [
2531  'sheets' => [
2532  'sheet_1' => [
2533  'ROOT' => [
2534  'el' => [
2535  'section_1' => [
2536  'type' => 'array',
2537  'section' => 1,
2538  'children' => [
2539  '1' => [
2540  'el' => [
2541  'containerField_1' => [],
2542  'containerField_2' => [
2543  'displayCond' => 'FIELD:containerField_1:!=:foo',
2544  ],
2545  ],
2546  ],
2547  ],
2548  ],
2549  ],
2550  ],
2551  ],
2552  ],
2553  ],
2554  ],
2555  ],
2556  ],
2557  ],
2558  ],
2559 
2560  'remove flex section container field by flex container field value of same container with dot in flex sheet name' => [
2561  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_2',
2562  [
2563  'field_1' => [
2564  'data' => [
2565  'sheet.1' => [
2566  'lDEF' => [
2567  'section_1' => [
2568  'el' => [
2569  '1' => [
2570  'container_1' => [
2571  'el' => [
2572  'containerField_1' => [
2573  'vDEF' => 'foo',
2574  ],
2575  ],
2576  ],
2577  ],
2578  ],
2579  ],
2580  ],
2581  ],
2582  ],
2583  ],
2584  ],
2585  [
2586  'columns' => [
2587  'field_1' => [
2588  'config' => [
2589  'type' => 'flex',
2590  'ds' => [
2591  'sheets' => [
2592  'sheet.1' => [
2593  'ROOT' => [
2594  'el' => [
2595  'section_1' => [
2596  'type' => 'array',
2597  'section' => 1,
2598  'children' => [
2599  '1' => [
2600  'el' => [
2601  'containerField_1' => [],
2602  'containerField_2' => [
2603  'displayCond' => 'FIELD:containerField_1:!=:foo',
2604  ],
2605  ],
2606  ],
2607  ],
2608  ],
2609  ],
2610  ],
2611  ],
2612  ],
2613  ],
2614  ],
2615  ],
2616  ],
2617  ],
2618  ],
2619 
2620  'remove flex section container field by flex container field value of same container with dot in container flex field name' => [
2621  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_2',
2622  [
2623  'field_1' => [
2624  'data' => [
2625  'sheet_1' => [
2626  'lDEF' => [
2627  'section_1' => [
2628  'el' => [
2629  '1' => [
2630  'container_1' => [
2631  'el' => [
2632  'containerField.1' => [
2633  'vDEF' => 'foo',
2634  ],
2635  ],
2636  ],
2637  ],
2638  ],
2639  ],
2640  ],
2641  ],
2642  ],
2643  ],
2644  ],
2645  [
2646  'columns' => [
2647  'field_1' => [
2648  'config' => [
2649  'type' => 'flex',
2650  'ds' => [
2651  'sheets' => [
2652  'sheet_1' => [
2653  'ROOT' => [
2654  'el' => [
2655  'section_1' => [
2656  'type' => 'array',
2657  'section' => 1,
2658  'children' => [
2659  '1' => [
2660  'el' => [
2661  'containerField.1' => [],
2662  'containerField_2' => [
2663  'displayCond' => 'FIELD:containerField.1:!=:foo',
2664  ],
2665  ],
2666  ],
2667  ],
2668  ],
2669  ],
2670  ],
2671  ],
2672  ],
2673  ],
2674  ],
2675  ],
2676  ],
2677  ],
2678  ],
2679 
2680  'remove flex section container field by flex container field value of same container with dot in flex sheet name and dot in container flex field name' => [
2681  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_2',
2682  [
2683  'field_1' => [
2684  'data' => [
2685  'sheet.1' => [
2686  'lDEF' => [
2687  'section_1' => [
2688  'el' => [
2689  '1' => [
2690  'container_1' => [
2691  'el' => [
2692  'containerField.1' => [
2693  'vDEF' => 'foo',
2694  ],
2695  ],
2696  ],
2697  ],
2698  ],
2699  ],
2700  ],
2701  ],
2702  ],
2703  ],
2704  ],
2705  [
2706  'columns' => [
2707  'field_1' => [
2708  'config' => [
2709  'type' => 'flex',
2710  'ds' => [
2711  'sheets' => [
2712  'sheet.1' => [
2713  'ROOT' => [
2714  'el' => [
2715  'section_1' => [
2716  'type' => 'array',
2717  'section' => 1,
2718  'children' => [
2719  '1' => [
2720  'el' => [
2721  'containerField.1' => [],
2722  'containerField_2' => [
2723  'displayCond' => 'FIELD:containerField.1:!=:foo',
2724  ],
2725  ],
2726  ],
2727  ],
2728  ],
2729  ],
2730  ],
2731  ],
2732  ],
2733  ],
2734  ],
2735  ],
2736  ],
2737  ],
2738  ],
2739 
2740  'remove flex section container field by flex container field value of same container with specified flex sheet name' => [
2741  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_2',
2742  [
2743  'field_1' => [
2744  'data' => [
2745  'sheet_1' => [
2746  'lDEF' => [
2747  'section_1' => [
2748  'el' => [
2749  '1' => [
2750  'container_1' => [
2751  'el' => [
2752  'containerField_1' => [
2753  'vDEF' => 'foo',
2754  ],
2755  ],
2756  ],
2757  ],
2758  ],
2759  ],
2760  ],
2761  ],
2762  ],
2763  ],
2764  ],
2765  [
2766  'columns' => [
2767  'field_1' => [
2768  'config' => [
2769  'type' => 'flex',
2770  'ds' => [
2771  'sheets' => [
2772  'sheet_1' => [
2773  'ROOT' => [
2774  'el' => [
2775  'section_1' => [
2776  'type' => 'array',
2777  'section' => 1,
2778  'children' => [
2779  '1' => [
2780  'el' => [
2781  'containerField_1' => [],
2782  'containerField_2' => [
2783  'displayCond' => 'FIELD:sheet_1.containerField_1:!=:foo',
2784  ],
2785  ],
2786  ],
2787  ],
2788  ],
2789  ],
2790  ],
2791  ],
2792  ],
2793  ],
2794  ],
2795  ],
2796  ],
2797  ],
2798  ],
2799 
2800  'remove flex section container field by flex container field value of same container with specified flex sheet name with dot in flex sheet name' => [
2801  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_2',
2802  [
2803  'field_1' => [
2804  'data' => [
2805  'sheet.1' => [
2806  'lDEF' => [
2807  'section_1' => [
2808  'el' => [
2809  '1' => [
2810  'container_1' => [
2811  'el' => [
2812  'containerField_1' => [
2813  'vDEF' => 'foo',
2814  ],
2815  ],
2816  ],
2817  ],
2818  ],
2819  ],
2820  ],
2821  ],
2822  ],
2823  ],
2824  ],
2825  [
2826  'columns' => [
2827  'field_1' => [
2828  'config' => [
2829  'type' => 'flex',
2830  'ds' => [
2831  'sheets' => [
2832  'sheet.1' => [
2833  'ROOT' => [
2834  'el' => [
2835  'section_1' => [
2836  'type' => 'array',
2837  'section' => 1,
2838  'children' => [
2839  '1' => [
2840  'el' => [
2841  'containerField_1' => [],
2842  'containerField_2' => [
2843  'displayCond' => 'FIELD:sheet.1.containerField_1:!=:foo',
2844  ],
2845  ],
2846  ],
2847  ],
2848  ],
2849  ],
2850  ],
2851  ],
2852  ],
2853  ],
2854  ],
2855  ],
2856  ],
2857  ],
2858  ],
2859 
2860  'remove flex section container field by flex container field value of same container with specified flex sheet name with dot in container flex field name' => [
2861  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_2',
2862  [
2863  'field_1' => [
2864  'data' => [
2865  'sheet_1' => [
2866  'lDEF' => [
2867  'section_1' => [
2868  'el' => [
2869  '1' => [
2870  'container_1' => [
2871  'el' => [
2872  'containerField.1' => [
2873  'vDEF' => 'foo',
2874  ],
2875  ],
2876  ],
2877  ],
2878  ],
2879  ],
2880  ],
2881  ],
2882  ],
2883  ],
2884  ],
2885  [
2886  'columns' => [
2887  'field_1' => [
2888  'config' => [
2889  'type' => 'flex',
2890  'ds' => [
2891  'sheets' => [
2892  'sheet_1' => [
2893  'ROOT' => [
2894  'el' => [
2895  'section_1' => [
2896  'type' => 'array',
2897  'section' => 1,
2898  'children' => [
2899  '1' => [
2900  'el' => [
2901  'containerField.1' => [],
2902  'containerField_2' => [
2903  'displayCond' => 'FIELD:sheet_1.containerField.1:!=:foo',
2904  ],
2905  ],
2906  ],
2907  ],
2908  ],
2909  ],
2910  ],
2911  ],
2912  ],
2913  ],
2914  ],
2915  ],
2916  ],
2917  ],
2918  ],
2919 
2920  'remove flex section container field by flex container field value of same container with specified flex sheet name with dot in flex sheet name and dot in container flex field name' => [
2921  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_2',
2922  [
2923  'field_1' => [
2924  'data' => [
2925  'sheet.1' => [
2926  'lDEF' => [
2927  'section_1' => [
2928  'el' => [
2929  '1' => [
2930  'container_1' => [
2931  'el' => [
2932  'containerField.1' => [
2933  'vDEF' => 'foo',
2934  ],
2935  ],
2936  ],
2937  ],
2938  ],
2939  ],
2940  ],
2941  ],
2942  ],
2943  ],
2944  ],
2945  [
2946  'columns' => [
2947  'field_1' => [
2948  'config' => [
2949  'type' => 'flex',
2950  'ds' => [
2951  'sheets' => [
2952  'sheet.1' => [
2953  'ROOT' => [
2954  'el' => [
2955  'section_1' => [
2956  'type' => 'array',
2957  'section' => 1,
2958  'children' => [
2959  '1' => [
2960  'el' => [
2961  'containerField.1' => [],
2962  'containerField_2' => [
2963  'displayCond' => 'FIELD:sheet.1.containerField.1:!=:foo',
2964  ],
2965  ],
2966  ],
2967  ],
2968  ],
2969  ],
2970  ],
2971  ],
2972  ],
2973  ],
2974  ],
2975  ],
2976  ],
2977  ],
2978  ],
2979 
2980  // flex section container field to flex field value of same container with naming clash to flex field value of same sheet
2981  'remove flex section container field by flex container field value of same container with naming clash' => [
2982  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/field_2',
2983  [
2984  'field_1' => [
2985  'data' => [
2986  'sheet_1' => [
2987  'lDEF' => [
2988  'field_1' => [
2989  'vDEF' => [
2990  0 => 'bar',
2991  ],
2992  ],
2993  'section_1' => [
2994  'el' => [
2995  '1' => [
2996  'container_1' => [
2997  'el' => [
2998  'field_1' => [
2999  'vDEF' => 'foo',
3000  ],
3001  ],
3002  ],
3003  ],
3004  ],
3005  ],
3006  ],
3007  ],
3008  ],
3009  ],
3010  ],
3011  [
3012  'columns' => [
3013  'field_1' => [
3014  'config' => [
3015  'type' => 'flex',
3016  'ds' => [
3017  'sheets' => [
3018  'sheet_1' => [
3019  'ROOT' => [
3020  'el' => [
3021  'section_1' => [
3022  'type' => 'array',
3023  'section' => 1,
3024  'children' => [
3025  '1' => [
3026  'el' => [
3027  'field_1' => [],
3028  'field_2' => [
3029  'displayCond' => 'FIELD:field_1:!=:foo',
3030  ],
3031  ],
3032  ],
3033  ],
3034  ],
3035  ],
3036  ],
3037  ],
3038  ],
3039  ],
3040  ],
3041  ],
3042  ],
3043  ],
3044  ],
3045 
3046  'remove flex section container field by flex container field value of same container with naming clash with dot in flex sheet name' => [
3047  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/field_2',
3048  [
3049  'field_1' => [
3050  'data' => [
3051  'sheet.1' => [
3052  'lDEF' => [
3053  'field_1' => [
3054  'vDEF' => [
3055  0 => 'bar',
3056  ],
3057  ],
3058  'section_1' => [
3059  'el' => [
3060  '1' => [
3061  'container_1' => [
3062  'el' => [
3063  'field_1' => [
3064  'vDEF' => 'foo',
3065  ],
3066  ],
3067  ],
3068  ],
3069  ],
3070  ],
3071  ],
3072  ],
3073  ],
3074  ],
3075  ],
3076  [
3077  'columns' => [
3078  'field_1' => [
3079  'config' => [
3080  'type' => 'flex',
3081  'ds' => [
3082  'sheets' => [
3083  'sheet.1' => [
3084  'ROOT' => [
3085  'el' => [
3086  'section_1' => [
3087  'type' => 'array',
3088  'section' => 1,
3089  'children' => [
3090  '1' => [
3091  'el' => [
3092  'field_1' => [],
3093  'field_2' => [
3094  'displayCond' => 'FIELD:field_1:!=:foo',
3095  ],
3096  ],
3097  ],
3098  ],
3099  ],
3100  ],
3101  ],
3102  ],
3103  ],
3104  ],
3105  ],
3106  ],
3107  ],
3108  ],
3109  ],
3110 
3111  'remove flex section container field by flex container field value of same container with naming clash with dot in flex field name' => [
3112  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/field_2',
3113  [
3114  'field_1' => [
3115  'data' => [
3116  'sheet_1' => [
3117  'lDEF' => [
3118  'field.1' => [
3119  'vDEF' => [
3120  0 => 'bar',
3121  ],
3122  ],
3123  'section_1' => [
3124  'el' => [
3125  '1' => [
3126  'container_1' => [
3127  'el' => [
3128  'field.1' => [
3129  'vDEF' => 'foo',
3130  ],
3131  ],
3132  ],
3133  ],
3134  ],
3135  ],
3136  ],
3137  ],
3138  ],
3139  ],
3140  ],
3141  [
3142  'columns' => [
3143  'field_1' => [
3144  'config' => [
3145  'type' => 'flex',
3146  'ds' => [
3147  'sheets' => [
3148  'sheet_1' => [
3149  'ROOT' => [
3150  'el' => [
3151  'section_1' => [
3152  'type' => 'array',
3153  'section' => 1,
3154  'children' => [
3155  '1' => [
3156  'el' => [
3157  'field.1' => [],
3158  'field_2' => [
3159  'displayCond' => 'FIELD:field.1:!=:foo',
3160  ],
3161  ],
3162  ],
3163  ],
3164  ],
3165  ],
3166  ],
3167  ],
3168  ],
3169  ],
3170  ],
3171  ],
3172  ],
3173  ],
3174  ],
3175 
3176  'remove flex section container field by flex container field value of same container with naming clash with dot in flex sheet name and dot in flex field name' => [
3177  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/field_2',
3178  [
3179  'field_1' => [
3180  'data' => [
3181  'sheet.1' => [
3182  'lDEF' => [
3183  'field.1' => [
3184  'vDEF' => [
3185  0 => 'bar',
3186  ],
3187  ],
3188  'section_1' => [
3189  'el' => [
3190  '1' => [
3191  'container_1' => [
3192  'el' => [
3193  'field.1' => [
3194  'vDEF' => 'foo',
3195  ],
3196  ],
3197  ],
3198  ],
3199  ],
3200  ],
3201  ],
3202  ],
3203  ],
3204  ],
3205  ],
3206  [
3207  'columns' => [
3208  'field_1' => [
3209  'config' => [
3210  'type' => 'flex',
3211  'ds' => [
3212  'sheets' => [
3213  'sheet.1' => [
3214  'ROOT' => [
3215  'el' => [
3216  'section_1' => [
3217  'type' => 'array',
3218  'section' => 1,
3219  'children' => [
3220  '1' => [
3221  'el' => [
3222  'field.1' => [],
3223  'field_2' => [
3224  'displayCond' => 'FIELD:field.1:!=:foo',
3225  ],
3226  ],
3227  ],
3228  ],
3229  ],
3230  ],
3231  ],
3232  ],
3233  ],
3234  ],
3235  ],
3236  ],
3237  ],
3238  ],
3239  ],
3240 
3241  'remove flex section container field by flex container field value of same container with naming clash with specified flex sheet name' => [
3242  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/field_2',
3243  [
3244  'field_1' => [
3245  'data' => [
3246  'sheet_1' => [
3247  'lDEF' => [
3248  'field_1' => [
3249  'vDEF' => [
3250  0 => 'bar',
3251  ],
3252  ],
3253  'section_1' => [
3254  'el' => [
3255  '1' => [
3256  'container_1' => [
3257  'el' => [
3258  'field_1' => [
3259  'vDEF' => 'foo',
3260  ],
3261  ],
3262  ],
3263  ],
3264  ],
3265  ],
3266  ],
3267  ],
3268  ],
3269  ],
3270  ],
3271  [
3272  'columns' => [
3273  'field_1' => [
3274  'config' => [
3275  'type' => 'flex',
3276  'ds' => [
3277  'sheets' => [
3278  'sheet_1' => [
3279  'ROOT' => [
3280  'el' => [
3281  'section_1' => [
3282  'type' => 'array',
3283  'section' => 1,
3284  'children' => [
3285  '1' => [
3286  'el' => [
3287  'field_1' => [],
3288  'field_2' => [
3289  'displayCond' => 'FIELD:sheet_1.field_1:!=:foo',
3290  ],
3291  ],
3292  ],
3293  ],
3294  ],
3295  ],
3296  ],
3297  ],
3298  ],
3299  ],
3300  ],
3301  ],
3302  ],
3303  ],
3304  ],
3305 
3306  'remove flex section container field by flex container field value of same container with naming clash with specified flex sheet name with dot in flex sheet name' => [
3307  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/field_2',
3308  [
3309  'field_1' => [
3310  'data' => [
3311  'sheet.1' => [
3312  'lDEF' => [
3313  'field_1' => [
3314  'vDEF' => [
3315  0 => 'bar',
3316  ],
3317  ],
3318  'section_1' => [
3319  'el' => [
3320  '1' => [
3321  'container_1' => [
3322  'el' => [
3323  'field_1' => [
3324  'vDEF' => 'foo',
3325  ],
3326  ],
3327  ],
3328  ],
3329  ],
3330  ],
3331  ],
3332  ],
3333  ],
3334  ],
3335  ],
3336  [
3337  'columns' => [
3338  'field_1' => [
3339  'config' => [
3340  'type' => 'flex',
3341  'ds' => [
3342  'sheets' => [
3343  'sheet.1' => [
3344  'ROOT' => [
3345  'el' => [
3346  'section_1' => [
3347  'type' => 'array',
3348  'section' => 1,
3349  'children' => [
3350  '1' => [
3351  'el' => [
3352  'field_1' => [],
3353  'field_2' => [
3354  'displayCond' => 'FIELD:sheet.1.field_1:!=:foo',
3355  ],
3356  ],
3357  ],
3358  ],
3359  ],
3360  ],
3361  ],
3362  ],
3363  ],
3364  ],
3365  ],
3366  ],
3367  ],
3368  ],
3369  ],
3370 
3371  'remove flex section container field by flex container field value of same container with naming clash with specified flex sheet name with dot in flex field name' => [
3372  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/field_2',
3373  [
3374  'field_1' => [
3375  'data' => [
3376  'sheet_1' => [
3377  'lDEF' => [
3378  'field.1' => [
3379  'vDEF' => [
3380  0 => 'bar',
3381  ],
3382  ],
3383  'section_1' => [
3384  'el' => [
3385  '1' => [
3386  'container_1' => [
3387  'el' => [
3388  'field.1' => [
3389  'vDEF' => 'foo',
3390  ],
3391  ],
3392  ],
3393  ],
3394  ],
3395  ],
3396  ],
3397  ],
3398  ],
3399  ],
3400  ],
3401  [
3402  'columns' => [
3403  'field_1' => [
3404  'config' => [
3405  'type' => 'flex',
3406  'ds' => [
3407  'sheets' => [
3408  'sheet_1' => [
3409  'ROOT' => [
3410  'el' => [
3411  'section_1' => [
3412  'type' => 'array',
3413  'section' => 1,
3414  'children' => [
3415  '1' => [
3416  'el' => [
3417  'field.1' => [],
3418  'field_2' => [
3419  'displayCond' => 'FIELD:sheet_1.field.1:!=:foo',
3420  ],
3421  ],
3422  ],
3423  ],
3424  ],
3425  ],
3426  ],
3427  ],
3428  ],
3429  ],
3430  ],
3431  ],
3432  ],
3433  ],
3434  ],
3435 
3436  'remove flex section container field by flex container field value of same container with naming clash with specified flex sheet name with dot in flex sheet name and dot in flex field name' => [
3437  'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/field_2',
3438  [
3439  'field_1' => [
3440  'data' => [
3441  'sheet.1' => [
3442  'lDEF' => [
3443  'field.1' => [
3444  'vDEF' => [
3445  0 => 'bar',
3446  ],
3447  ],
3448  'section_1' => [
3449  'el' => [
3450  '1' => [
3451  'container_1' => [
3452  'el' => [
3453  'field.1' => [
3454  'vDEF' => 'foo',
3455  ],
3456  ],
3457  ],
3458  ],
3459  ],
3460  ],
3461  ],
3462  ],
3463  ],
3464  ],
3465  ],
3466  [
3467  'columns' => [
3468  'field_1' => [
3469  'config' => [
3470  'type' => 'flex',
3471  'ds' => [
3472  'sheets' => [
3473  'sheet.1' => [
3474  'ROOT' => [
3475  'el' => [
3476  'section_1' => [
3477  'type' => 'array',
3478  'section' => 1,
3479  'children' => [
3480  '1' => [
3481  'el' => [
3482  'field.1' => [],
3483  'field_2' => [
3484  'displayCond' => 'FIELD:sheet.1.field.1:!=:foo',
3485  ],
3486  ],
3487  ],
3488  ],
3489  ],
3490  ],
3491  ],
3492  ],
3493  ],
3494  ],
3495  ],
3496  ],
3497  ],
3498  ],
3499  ],
3500 
3501  // Some special scenarios
3502  'remove flex sheet by nested OR condition' => [
3503  'columns/field_1/config/ds/sheets/sheet_2',
3504  [
3505  'field_1' => [
3506  'data' => [
3507  'sheet_1' => [
3508  'lDEF' => [
3509  'field_1' => [
3510  'vDEF' => [
3511  0 => 'foo',
3512  ],
3513  ],
3514  ],
3515  ],
3516  ],
3517  ],
3518  ],
3519  [
3520  'columns' => [
3521  'field_1' => [
3522  'config' => [
3523  'type' => 'flex',
3524  'ds' => [
3525  'sheets' => [
3526  'sheet_1' => [
3527  'ROOT' => [
3528  'type' => 'array',
3529  'el' => [
3530  'field_1' => [],
3531  ],
3532  ],
3533  ],
3534  'sheet_2' => [
3535  'ROOT' => [
3536  'type' => 'array',
3537  'el' => [],
3538  'displayCond' => [
3539  'OR' => [
3540  'FIELD:sheet_1.field_1:=:LIST',
3541  'FIELD:sheet_1.field_1:!=:foo',
3542  ],
3543  ],
3544  ],
3545  ],
3546  ],
3547  ],
3548  ],
3549  ],
3550  ],
3551  ],
3552  ],
3553 
3554  // flex section container has a display condition
3555  'remove flex section container' => [
3556  'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1',
3557  [
3558  'field_1' => [
3559  'data' => [
3560  'sheet_1' => [
3561  'lDEF' => [
3562  'field_1' => [
3563  'vDEF' => [
3564  0 => 'foo',
3565  ],
3566  ],
3567  ],
3568  ],
3569  ],
3570  ],
3571  ],
3572  [
3573  'columns' => [
3574  'field_1' => [
3575  'config' => [
3576  'type' => 'flex',
3577  'ds' => [
3578  'sheets' => [
3579  'sheet_1' => [
3580  'ROOT' => [
3581  'el' => [
3582  'field_1' => [],
3583  'section_1' => [
3584  'type' => 'array',
3585  'section' => 1,
3586  'displayCond' => 'FIELD:field_1:!=:foo',
3587  'children' => [],
3588  ],
3589  ],
3590  ],
3591  ],
3592  ],
3593  ],
3594  ],
3595  ],
3596  ],
3597  ],
3598  ],
3599 
3600  // field name to sheet name overlap
3601  'remove flex field even if sheet name and field name overlap' => [
3602  'columns/field_1/config/ds/sheets/field_1/ROOT/el/field_2',
3603  [
3604  'field_1' => [
3605  'data' => [
3606  'field_1' => [
3607  'lDEF' => [
3608  'field_1' => [
3609  'vDEF' => [
3610  0 => 'foo',
3611  ],
3612  ],
3613  ],
3614  ],
3615  ],
3616  ],
3617  ],
3618  [
3619  'columns' => [
3620  'field_1' => [
3621  'config' => [
3622  'type' => 'flex',
3623  'ds' => [
3624  'sheets' => [
3625  'field_1' => [
3626  'ROOT' => [
3627  'el' => [
3628  'field_1' => [],
3629  'field_2' => [
3630  'displayCond' => 'FIELD:field_1.field_1:!=:foo',
3631  ],
3632  ],
3633  ],
3634  ],
3635  ],
3636  ],
3637  ],
3638  ],
3639  ],
3640  ],
3641  ],
3642 
3643  ];
3644  }
3645 
3653  public function addDataRemovesTcaReferencingOtherFieldsInDisplayCondition($processedTcaFieldToBeRemovedPath, array $databaseRow, array $processedTca)
3654  {
3655  $input = [
3656  'databaseRow' => $databaseRow,
3657  'processedTca' => $processedTca,
3658  ];
3659  $expected = ArrayUtility::removeByPath($input, 'processedTca/' . $processedTcaFieldToBeRemovedPath);
3660  $this->assertSame($expected, (new EvaluateDisplayConditions())->addData($input));
3661  }
3662 
3673  {
3674  return [
3675  'Field is not greater zero if not given' => [
3676  'FIELD:uid:>:0',
3677  [],
3678  false,
3679  ],
3680  'Field is not equal 0 if not given' => [
3681  'FIELD:uid:=:0',
3682  [],
3683  false,
3684  ],
3685  'Field is not greater zero if empty array given' => [
3686  'FIELD:foo:>:0',
3687  ['foo' => []],
3688  false,
3689  ],
3690  'Field is not greater than or equal to zero if empty array given' => [
3691  'FIELD:foo:>=:0',
3692  ['foo' => []],
3693  false,
3694  ],
3695  'Field is less than 1 if empty array given' => [
3696  'FIELD:foo:<:1',
3697  ['foo' => []],
3698  true,
3699  ],
3700  'Field is less than or equal to 1 if empty array given' => [
3701  'FIELD:foo:<=:1',
3702  ['foo' => []],
3703  true,
3704  ],
3705  'Field does not equal 0 if empty array given' => [
3706  'FIELD:foo:=:0',
3707  ['foo' => []],
3708  false,
3709  ],
3710  'Field value string comparison' => [
3711  'FIELD:foo:=:bar',
3712  ['foo' => 'bar'],
3713  true,
3714  ],
3715  'Field value string comparison against list' => [
3716  'FIELD:foo:IN:bar,baz',
3717  ['foo' => 'baz'],
3718  true,
3719  ],
3720  'Field value comparison of 1 against multi-value field of 5 returns true' => [
3721  'FIELD:content:BIT:1',
3722  ['content' => '5'],
3723  true,
3724  ],
3725  'Field value comparison of 2 against multi-value field of 5 returns false' => [
3726  'FIELD:content:BIT:2',
3727  ['content' => '5'],
3728  false,
3729  ],
3730  'Field value of 5 negated comparison against multi-value field of 5 returns false' => [
3731  'FIELD:content:!BIT:5',
3732  ['content' => '5'],
3733  false,
3734  ],
3735  'Field value comparison for required value is false for different value' => [
3736  'FIELD:foo:REQ:FALSE',
3737  ['foo' => 'bar'],
3738  false,
3739  ],
3740  'Field value string not equal comparison' => [
3741  'FIELD:foo:!=:baz',
3742  ['foo' => 'bar'],
3743  true,
3744  ],
3745  'Field value string not equal comparison against list' => [
3746  'FIELD:foo:!IN:bar,baz',
3747  ['foo' => 'foo'],
3748  true,
3749  ],
3750  'Field value in range' => [
3751  'FIELD:uid:-:3-42',
3752  ['uid' => '23'],
3753  true,
3754  ],
3755  'Field value greater than' => [
3756  'FIELD:uid:>=:42',
3757  ['uid' => '23'],
3758  false,
3759  ],
3760  'Field value containing colons' => [
3761  'FIELD:foo:=:x:y:z',
3762  ['foo' => 'x:y:z'],
3763  true,
3764  ],
3765  'New is TRUE for new comparison with TRUE' => [
3766  'REC:NEW:TRUE',
3767  ['uid' => null],
3768  true,
3769  ],
3770  'New is FALSE for new comparison with FALSE' => [
3771  'REC:NEW:FALSE',
3772  ['uid' => null],
3773  false,
3774  ],
3775  'New is FALSE for not new element' => [
3776  'REC:NEW:TRUE',
3777  ['uid' => 42],
3778  false,
3779  ],
3780  'New is TRUE for not new element compared to FALSE' => [
3781  'REC:NEW:FALSE',
3782  ['uid' => 42],
3783  true,
3784  ],
3785  'Version is TRUE for versioned row' => [
3786  'VERSION:IS:TRUE',
3787  [
3788  'uid' => 42,
3789  'pid' => -1,
3790  ],
3791  true,
3792  ],
3793  'Version is TRUE for not versioned row compared with FALSE' => [
3794  'VERSION:IS:FALSE',
3795  [
3796  'uid' => 42,
3797  'pid' => 1,
3798  ],
3799  true,
3800  ],
3801  'Version is TRUE for NULL row compared with TRUE' => [
3802  'VERSION:IS:TRUE',
3803  [
3804  'uid' => null,
3805  'pid' => null,
3806  ],
3807  false,
3808  ],
3809  'Multiple conditions with AND compare to TRUE if all are OK' => [
3810  [
3811  'AND' => [
3812  'FIELD:testField:>:9',
3813  'FIELD:testField:<:11',
3814  ],
3815  ],
3816  [
3817  'testField' => 10,
3818  ],
3819  true,
3820  ],
3821  'Multiple conditions with AND compare to FALSE if one fails' => [
3822  [
3823  'AND' => [
3824  'FIELD:testField:>:9',
3825  'FIELD:testField:<:11',
3826  ],
3827  ],
3828  [
3829  'testField' => 99,
3830  ],
3831  false,
3832  ],
3833  'Multiple conditions with OR compare to TRUE if one is OK' => [
3834  [
3835  'OR' => [
3836  'FIELD:testField:<:9',
3837  'FIELD:testField:<:11',
3838  ],
3839  ],
3840  [
3841  'testField' => 10,
3842  ],
3843  true,
3844  ],
3845  'Multiple conditions with OR compare to FALSE is all fail' => [
3846  [
3847  'OR' => [
3848  'FIELD:testField:<:9',
3849  'FIELD:testField:<:11',
3850  ],
3851  ],
3852  [
3853  'testField' => 99,
3854  ],
3855  false,
3856  ],
3857  'Multiple nested conditions evaluate to TRUE' => [
3858  [
3859  'AND' => [
3860  'FIELD:testField:>:9',
3861  'OR' => [
3862  'FIELD:testField:<:100',
3863  'FIELD:testField:>:-100',
3864  ],
3865  ],
3866  ],
3867  [
3868  'testField' => 10,
3869  ],
3870  true,
3871  ],
3872  'Multiple nested conditions evaluate to FALSE' => [
3873  [
3874  'AND' => [
3875  'FIELD:testField:>:9',
3876  'OR' => [
3877  'FIELD:testField:<:100',
3878  'FIELD:testField:>:-100',
3879  ],
3880  ],
3881  ],
3882  [
3883  'testField' => -999,
3884  ],
3885  false,
3886  ],
3887  ];
3888  }
3889 
3897  public function matchConditionStrings($condition, array $record, $expectedResult)
3898  {
3899  $input = [
3900  'databaseRow' => $record,
3901  'processedTca' => [
3902  'columns' => [
3903  'testField' => [
3904  'displayCond' => $condition,
3905  'config' => [
3906  'type' => 'input',
3907  ],
3908  ],
3909  ],
3910  ],
3911  ];
3912 
3913  $expected = $input;
3914  if ($expectedResult) {
3915  // displayCond vanished from result array after this data provider is done
3916  unset($expected['processedTca']['columns']['testField']['displayCond']);
3917  } else {
3918  unset($expected['processedTca']['columns']['testField']);
3919  }
3920  $this->assertSame($expected, (new EvaluateDisplayConditions())->addData($input));
3921  }
3922 
3930  public function matchConditionStringsWithRecordTestFieldBeingArray($condition, array $record, $expectedResult)
3931  {
3932  $input = [
3933  'processedTca' => [
3934  'columns' => [
3935  'testField' => [
3936  'displayCond' => $condition,
3937  'config' => [
3938  'type' => 'input',
3939  ],
3940  ],
3941  ],
3942  ],
3943  ];
3944  $input['databaseRow'] = $record;
3945  if (!empty($record['testField'])) {
3946  $input['databaseRow'] = [
3947  'testField' => [
3948  'key' => $record['testField'],
3949  ],
3950  ];
3951  }
3952 
3953  $backendUserAuthenticationProphecy = $this->prophesize(BackendUserAuthentication::class);
3954  $GLOBALS['BE_USER'] = $backendUserAuthenticationProphecy->reveal();
3955 
3956  $expected = $input;
3957  if ($expectedResult) {
3958  // displayCond vanished from result array after this data provider is done
3959  unset($expected['processedTca']['columns']['testField']['displayCond']);
3960  } else {
3961  unset($expected['processedTca']['columns']['testField']);
3962  }
3963  $this->assertSame($expected, (new EvaluateDisplayConditions())->addData($input));
3964  }
3965 
3969  public function matchHideForNonAdminsReturnsTrueIfBackendUserIsAdmin()
3970  {
3971  $input = [
3972  'databaseRow' => [],
3973  'processedTca' => [
3974  'columns' => [
3975  'aField' => [
3976  'displayCond' => 'HIDE_FOR_NON_ADMINS',
3977  'config' => [
3978  'type' => 'input',
3979  ],
3980  ],
3981  ],
3982  ],
3983  ];
3984 
3986  $backendUserProphecy = $this->prophesize(BackendUserAuthentication::class);
3987  $GLOBALS['BE_USER'] = $backendUserProphecy->reveal();
3988  $backendUserProphecy->isAdmin()->shouldBeCalled()->willReturn(true);
3989 
3990  $expected = $input;
3991  unset($expected['processedTca']['columns']['aField']['displayCond']);
3992 
3993  $this->assertSame($expected, (new EvaluateDisplayConditions())->addData($input));
3994  }
3995 
3999  public function matchHideForNonAdminsReturnsFalseIfBackendUserIsNotAdmin()
4000  {
4001  $input = [
4002  'databaseRow' => [],
4003  'processedTca' => [
4004  'columns' => [
4005  'aField' => [
4006  'displayCond' => 'HIDE_FOR_NON_ADMINS',
4007  'config' => [
4008  'type' => 'input',
4009  ],
4010  ],
4011  ],
4012  ],
4013  ];
4014 
4016  $backendUserProphecy = $this->prophesize(BackendUserAuthentication::class);
4017  $GLOBALS['BE_USER'] = $backendUserProphecy->reveal();
4018  $backendUserProphecy->isAdmin()->shouldBeCalled()->willReturn(false);
4019 
4020  $expected = $input;
4021  unset($expected['processedTca']['columns']['aField']);
4022  $this->assertSame($expected, (new EvaluateDisplayConditions())->addData($input));
4023  }
4024 }
addDataRemovesTcaReferencingOtherFieldsInDisplayCondition($processedTcaFieldToBeRemovedPath, array $databaseRow, array $processedTca)
static removeByPath(array $array, $path, $delimiter='/')
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']