2 declare(strict_types = 1);
18 use Prophecy\Prophecy\ObjectProphecy;
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
49 $this->expectException(\RuntimeException::class);
50 $this->expectExceptionCode(1481380393);
71 $this->expectException(\RuntimeException::class);
72 $this->expectExceptionCode(1481380393);
86 'displayCond' =>
false,
91 $this->expectException(\RuntimeException::class);
92 $this->expectExceptionCode(1481381058);
106 'displayCond' =>
'foo',
111 $this->expectException(\RuntimeException::class);
112 $this->expectExceptionCode(1481381950);
126 'displayCond' =>
'FIELD',
131 $this->expectException(\RuntimeException::class);
132 $this->expectExceptionCode(1481385695);
146 'displayCond' =>
'FIELD:fieldName',
151 $this->expectException(\RuntimeException::class);
152 $this->expectExceptionCode(1481386239);
166 'displayCond' =>
'FIELD:fieldName:foo',
171 $this->expectException(\RuntimeException::class);
172 $this->expectExceptionCode(1481386239);
186 'displayCond' =>
'FIELD:fieldName:REQ',
191 $this->expectException(\RuntimeException::class);
192 $this->expectExceptionCode(1481401543);
206 'displayCond' =>
'FIELD:fieldName:REQ:foo',
211 $this->expectException(\RuntimeException::class);
212 $this->expectExceptionCode(1481401892);
226 'displayCond' =>
'FIELD:fieldName:>=:foo',
231 $this->expectException(\RuntimeException::class);
232 $this->expectExceptionCode(1481456806);
246 'displayCond' =>
'FIELD:fieldName:-:23-',
251 $this->expectException(\RuntimeException::class);
252 $this->expectExceptionCode(1481457277);
266 'displayCond' =>
'FIELD:fieldName:-:23-foo',
271 $this->expectException(\RuntimeException::class);
272 $this->expectExceptionCode(1481457277);
286 'displayCond' =>
'REC',
291 $this->expectException(\RuntimeException::class);
292 $this->expectExceptionCode(1481384784);
306 'displayCond' =>
'REC:foo',
311 $this->expectException(\RuntimeException::class);
312 $this->expectExceptionCode(1481384784);
326 'displayCond' =>
'REC:NEW',
331 $this->expectException(\RuntimeException::class);
332 $this->expectExceptionCode(1481384947);
346 'displayCond' =>
'REC:NEW:foo',
351 $this->expectException(\RuntimeException::class);
352 $this->expectExceptionCode(1481385173);
366 'displayCond' =>
'REC:NEW:false',
371 $this->expectException(\RuntimeException::class);
372 $this->expectExceptionCode(1481467208);
386 'displayCond' =>
'VERSION',
391 $this->expectException(\RuntimeException::class);
392 $this->expectExceptionCode(1481383660);
406 'displayCond' =>
'VERSION:foo',
411 $this->expectException(\RuntimeException::class);
412 $this->expectExceptionCode(1481383660);
426 'displayCond' =>
'VERSION:IS',
431 $this->expectException(\RuntimeException::class);
432 $this->expectExceptionCode(1481383888);
446 'displayCond' =>
'VERSION:IS:foo',
451 $this->expectException(\RuntimeException::class);
452 $this->expectExceptionCode(1481384123);
466 'displayCond' =>
'VERSION:IS:false',
471 $this->expectException(\RuntimeException::class);
472 $this->expectExceptionCode(1481469854);
486 'displayCond' =>
'USER',
491 $this->expectException(\RuntimeException::class);
492 $this->expectExceptionCode(1481382954);
506 'displayCond' =>
'USER:' . self::class .
'->addDataEvaluatesUserConditionCallback:more:arguments',
511 $this->expectException(\RuntimeException::class);
512 $this->expectExceptionCode(1488130499);
528 'flexformValueKey' =>
'vDEF',
529 'conditionParameters' => [
534 if ($expected === $parameter) {
535 throw new \RuntimeException(
'testing', 1488130499);
549 'displayCond' =>
'USER:' . self::class .
'->addDataResolvesAllUserParametersCallback:some:more:info',
559 unset($expected[
'processedTca'][
'columns'][
'field_1'][
'displayCond']);
580 if ($expected !== $parameter[
'conditionParameters']) {
581 throw new \RuntimeException(
'testing', 1538055997);
606 'displayCond' =>
'USER:' . self::class .
'->addDataPassesFlexContextToUserConditionCallback:some:info',
620 unset($expected[
'processedTca'][
'columns'][
'field_1'][
'config'][
'ds'][
'sheets'][
'sDEF'][
'ROOT'][
'el'][
'foo'][
'displayCond']);
636 'context' =>
'flexField',
637 'sheetNameFieldNames' => [
639 'sheetName' =>
'sDEF',
640 'fieldName' =>
'foo',
643 'currentSheetName' =>
'sDEF',
644 'currentFieldName' =>
'foo',
645 'flexFormDataStructure' => [
652 'displayCond' =>
'USER:' . self::class .
'->addDataPassesFlexContextToUserConditionCallback:some:info'
659 'flexFormRowData' =>
null,
662 if ($expected !== $parameter[
'flexContext']) {
663 throw new \RuntimeException(
'testing', 1538057402);
704 $this->expectException(\RuntimeException::class);
705 $this->expectExceptionCode(1481483061);
725 'displayCond' =>
'FIELD:aSheet.aField:=:foo',
738 $this->expectException(\RuntimeException::class);
739 $this->expectExceptionCode(1481485705);
760 'displayCond' =>
'FIELD:sheet_1.flexField_1:!=:foo',
770 $this->expectException(\RuntimeException::class);
771 $this->expectExceptionCode(1481488492);
794 'displayCond' =>
'FIELD:flexField_1:!=:foo',
806 $this->expectException(\RuntimeException::class);
807 $this->expectExceptionCode(1481492953);
829 'displayCond' =>
'FIELD:foo.flexField_1:!=:foo',
841 $this->expectException(\RuntimeException::class);
842 $this->expectExceptionCode(1481496170);
885 'containerField_1' => [
886 'displayCond' =>
'FIELD:flexField_1:!=:foo',
902 $this->expectException(\RuntimeException::class);
903 $this->expectExceptionCode(1481634649);
917 'remove tca field by tca field value' => [
928 'displayCond' =>
'FIELD:field_1:!=:foo',
935 'remove flex form field by tca field value' => [
936 'columns/field_2/config/ds/sheets/sheet_1/ROOT/el/flexField_1',
951 'displayCond' =>
'FIELD:parentRec.field_1:!=:foo',
965 'remove flex form field by flex field value on same flex sheet' => [
966 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/flexField_2',
994 'displayCond' =>
'FIELD:flexField_1:!=:foo',
1007 'remove flex form field by flex field value on same flex sheet with dot in flex sheet name' => [
1008 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/flexField_2',
1034 'flexField_1' => [],
1036 'displayCond' =>
'FIELD:flexField_1:!=:foo',
1049 'remove flex form field by flex field value on same flex sheet with dot in flex field name' => [
1050 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/flexField_2',
1076 'flexField.1' => [],
1078 'displayCond' =>
'FIELD:flexField.1:!=:foo',
1091 'remove flex form field by flex field value on same flex sheet with dot in flex sheet name and dot in flex field name' => [
1092 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/flexField_2',
1118 'flexField.1' => [],
1120 'displayCond' =>
'FIELD:flexField.1:!=:foo',
1133 'remove flex form field by flex field value on same flex sheet with specified flex sheet name' => [
1134 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/flexField_2',
1160 'flexField_1' => [],
1162 'displayCond' =>
'FIELD:sheet_1.flexField_1:!=:foo',
1175 'remove flex form field by flex field value on same flex sheet with specified flex sheet name with dot in flex sheet name' => [
1176 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/flexField_2',
1202 'flexField_1' => [],
1204 'displayCond' =>
'FIELD:sheet.1.flexField_1:!=:foo',
1217 'remove flex form field by flex field value on same flex sheet with specified flex sheet name with dot in flex field name' => [
1218 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/flexField_2',
1244 'flexField.1' => [],
1246 'displayCond' =>
'FIELD:sheet_1.flexField.1:!=:foo',
1259 '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' => [
1260 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/flexField_2',
1286 'flexField.1' => [],
1288 'displayCond' =>
'FIELD:sheet.1.flexField.1:!=:foo',
1302 'remove flex form field by flex field value on other flex sheet' => [
1303 'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/flexField_1',
1329 'flexField_1' => [],
1337 'displayCond' =>
'FIELD:sheet_1.flexField_1:!=:foo',
1350 'remove flex form field by flex field value on other flex sheet with dot in flex sheet name' => [
1351 'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/flexField_1',
1377 'flexField_1' => [],
1385 'displayCond' =>
'FIELD:sheet.1.flexField_1:!=:foo',
1398 'remove flex form field by flex field value on other flex sheet with dot in flex field name' => [
1399 'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/flexField_1',
1425 'flexField.1' => [],
1433 'displayCond' =>
'FIELD:sheet_1.flexField.1:!=:foo',
1446 'remove flex form field by flex field value on other flex sheet with dot in flex sheet name and dot in flex field name' => [
1447 'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/flexField_1',
1473 'flexField.1' => [],
1481 'displayCond' =>
'FIELD:sheet.1.flexField.1:!=:foo',
1495 'remove flex form sheet by tca field value' => [
1496 'columns/field_2/config/ds/sheets/sheet_1',
1509 'displayCond' =>
'FIELD:parentRec.field_1:!=:foo',
1521 'remove flex form sheet by flex field value on different flex sheet' => [
1522 'columns/field_1/config/ds/sheets/sheet_2',
1548 'flexField_1' => [],
1554 'displayCond' =>
'FIELD:sheet_1.flexField_1:!=:foo',
1565 'remove flex form sheet by flex field value on different flex sheet with dot in flex sheet name' => [
1566 'columns/field_1/config/ds/sheets/sheet.2',
1592 'flexField_1' => [],
1598 'displayCond' =>
'FIELD:sheet.1.flexField_1:!=:foo',
1609 'remove flex form sheet by flex field value on different flex sheet with dot in flex field name' => [
1610 'columns/field_1/config/ds/sheets/sheet_2',
1636 'flexField.1' => [],
1642 'displayCond' =>
'FIELD:sheet_1.flexField.1:!=:foo',
1653 'remove flex form sheet by flex field value on different flex sheet with dot in flex sheet name and dot in flex field name' => [
1654 'columns/field_1/config/ds/sheets/sheet.2',
1680 'flexField.1' => [],
1686 'displayCond' =>
'FIELD:sheet.1.flexField.1:!=:foo',
1698 'remove flex section container field by tca field value' => [
1699 'columns/field_2/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
1732 'containerField_1' => [
1733 'displayCond' =>
'FIELD:parentRec.field_1:!=:foo',
1751 'remove flex section container field by flex field value on same flex sheet' => [
1752 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
1783 'flexField_1' => [],
1790 'containerField_1' => [
1791 'displayCond' =>
'FIELD:flexField_1:!=:foo',
1808 'remove flex section container field by flex field value on same flex sheet with dot in flex sheet name' => [
1809 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_1',
1840 'flexField_1' => [],
1847 'containerField_1' => [
1848 'displayCond' =>
'FIELD:flexField_1:!=:foo',
1865 'remove flex section container field by flex field value on same flex sheet with dot in flex field name' => [
1866 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
1897 'flexField.1' => [],
1904 'containerField_1' => [
1905 'displayCond' =>
'FIELD:flexField.1:!=:foo',
1922 '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' => [
1923 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_1',
1954 'flexField.1' => [],
1961 'containerField_1' => [
1962 'displayCond' =>
'FIELD:flexField.1:!=:foo',
1979 'remove flex section container field by flex field value on same flex sheet with specified flex sheet name' => [
1980 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
2011 'flexField_1' => [],
2018 'containerField_1' => [
2019 'displayCond' =>
'FIELD:sheet_1.flexField_1:!=:foo',
2036 'remove flex section container field by flex field value on same flex sheet with specified flex sheet name with dot in flex sheet name' => [
2037 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_1',
2068 'flexField_1' => [],
2075 'containerField_1' => [
2076 'displayCond' =>
'FIELD:sheet.1.flexField_1:!=:foo',
2093 'remove flex section container field by flex field value on same flex sheet with specified flex sheet name with dot in flex field name' => [
2094 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_1',
2125 'flexField.1' => [],
2132 'containerField_1' => [
2133 'displayCond' =>
'FIELD:sheet_1.flexField.1:!=:foo',
2150 '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' => [
2151 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_1',
2182 'flexField.1' => [],
2189 'containerField_1' => [
2190 'displayCond' =>
'FIELD:sheet.1.flexField.1:!=:foo',
2208 'remove flex section container field by flex field value on other flex sheet' => [
2209 'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/section_1/children/1/el/containerField_1',
2244 'flexField_1' => [],
2257 'containerField_1' => [
2258 'displayCond' =>
'FIELD:sheet_1.flexField_1:!=:foo',
2275 'remove flex section container field by flex field value on other flex sheet with dot in flex sheet name' => [
2276 'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/section_1/children/1/el/containerField_1',
2311 'flexField_1' => [],
2324 'containerField_1' => [
2325 'displayCond' =>
'FIELD:sheet.1.flexField_1:!=:foo',
2342 'remove flex section container field by flex field value on other flex sheet with dot in flex field name' => [
2343 'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/section_1/children/1/el/containerField_1',
2378 'flexField.1' => [],
2391 'containerField_1' => [
2392 'displayCond' =>
'FIELD:sheet_1.flexField.1:!=:foo',
2409 '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' => [
2410 'columns/field_1/config/ds/sheets/sheet_2/ROOT/el/section_1/children/1/el/containerField_1',
2445 'flexField.1' => [],
2458 'containerField_1' => [
2459 'displayCond' =>
'FIELD:sheet.1.flexField.1:!=:foo',
2477 'remove flex section container field by flex container field value of same container' => [
2478 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_2',
2489 'containerField_1' => [
2518 'containerField_1' => [],
2519 'containerField_2' => [
2520 'displayCond' =>
'FIELD:containerField_1:!=:foo',
2537 'remove flex section container field by flex container field value of same container with dot in flex sheet name' => [
2538 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_2',
2549 'containerField_1' => [
2578 'containerField_1' => [],
2579 'containerField_2' => [
2580 'displayCond' =>
'FIELD:containerField_1:!=:foo',
2597 'remove flex section container field by flex container field value of same container with dot in container flex field name' => [
2598 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_2',
2609 'containerField.1' => [
2638 'containerField.1' => [],
2639 'containerField_2' => [
2640 'displayCond' =>
'FIELD:containerField.1:!=:foo',
2657 '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' => [
2658 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_2',
2669 'containerField.1' => [
2698 'containerField.1' => [],
2699 'containerField_2' => [
2700 'displayCond' =>
'FIELD:containerField.1:!=:foo',
2717 'remove flex section container field by flex container field value of same container with specified flex sheet name' => [
2718 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_2',
2729 'containerField_1' => [
2758 'containerField_1' => [],
2759 'containerField_2' => [
2760 'displayCond' =>
'FIELD:sheet_1.containerField_1:!=:foo',
2777 'remove flex section container field by flex container field value of same container with specified flex sheet name with dot in flex sheet name' => [
2778 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_2',
2789 'containerField_1' => [
2818 'containerField_1' => [],
2819 'containerField_2' => [
2820 'displayCond' =>
'FIELD:sheet.1.containerField_1:!=:foo',
2837 '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' => [
2838 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/containerField_2',
2849 'containerField.1' => [
2878 'containerField.1' => [],
2879 'containerField_2' => [
2880 'displayCond' =>
'FIELD:sheet_1.containerField.1:!=:foo',
2897 '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' => [
2898 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/containerField_2',
2909 'containerField.1' => [
2938 'containerField.1' => [],
2939 'containerField_2' => [
2940 'displayCond' =>
'FIELD:sheet.1.containerField.1:!=:foo',
2958 'remove flex section container field by flex container field value of same container with naming clash' => [
2959 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/field_2',
3006 'displayCond' =>
'FIELD:field_1:!=:foo',
3023 'remove flex section container field by flex container field value of same container with naming clash with dot in flex sheet name' => [
3024 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/field_2',
3071 'displayCond' =>
'FIELD:field_1:!=:foo',
3088 'remove flex section container field by flex container field value of same container with naming clash with dot in flex field name' => [
3089 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/field_2',
3136 'displayCond' =>
'FIELD:field.1:!=:foo',
3153 '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' => [
3154 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/field_2',
3201 'displayCond' =>
'FIELD:field.1:!=:foo',
3218 'remove flex section container field by flex container field value of same container with naming clash with specified flex sheet name' => [
3219 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/field_2',
3266 'displayCond' =>
'FIELD:sheet_1.field_1:!=:foo',
3283 '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' => [
3284 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/field_2',
3331 'displayCond' =>
'FIELD:sheet.1.field_1:!=:foo',
3348 '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' => [
3349 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1/children/1/el/field_2',
3396 'displayCond' =>
'FIELD:sheet_1.field.1:!=:foo',
3413 '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' => [
3414 'columns/field_1/config/ds/sheets/sheet.1/ROOT/el/section_1/children/1/el/field_2',
3461 'displayCond' =>
'FIELD:sheet.1.field.1:!=:foo',
3479 'remove flex sheet by nested OR condition' => [
3480 'columns/field_1/config/ds/sheets/sheet_2',
3517 'FIELD:sheet_1.field_1:=:LIST',
3518 'FIELD:sheet_1.field_1:!=:foo',
3532 'remove flex section container' => [
3533 'columns/field_1/config/ds/sheets/sheet_1/ROOT/el/section_1',
3563 'displayCond' =>
'FIELD:field_1:!=:foo',
3578 'remove flex field even if sheet name and field name overlap' => [
3579 'columns/field_1/config/ds/sheets/field_1/ROOT/el/field_2',
3607 'displayCond' =>
'FIELD:field_1.field_1:!=:foo',
3633 'databaseRow' => $databaseRow,
3634 'processedTca' => $processedTca,
3652 'Field is not greater zero if not given' => [
3657 'Field is not equal 0 if not given' => [
3662 'Field is not greater zero if empty array given' => [
3667 'Field is not greater than or equal to zero if empty array given' => [
3672 'Field is less than 1 if empty array given' => [
3677 'Field is less than or equal to 1 if empty array given' => [
3682 'Field does not equal 0 if empty array given' => [
3687 'Field value string comparison' => [
3692 'Field value string comparison against list' => [
3693 'FIELD:foo:IN:bar,baz',
3697 'Field value comparison of 1 against multi-value field of 5 returns true' => [
3698 'FIELD:content:BIT:1',
3702 'Field value comparison of 2 against multi-value field of 5 returns false' => [
3703 'FIELD:content:BIT:2',
3707 'Field value of 5 negated comparison against multi-value field of 5 returns false' => [
3708 'FIELD:content:!BIT:5',
3712 'Field value comparison for required value is false for different value' => [
3713 'FIELD:foo:REQ:FALSE',
3717 'Field value string not equal comparison' => [
3722 'Field value string not equal comparison against list' => [
3723 'FIELD:foo:!IN:bar,baz',
3727 'Field value in range' => [
3732 'Field value greater than' => [
3737 'Field value containing colons' => [
3738 'FIELD:foo:=:x:y:z',
3742 'New is TRUE for new comparison with TRUE' => [
3747 'New is FALSE for new comparison with FALSE' => [
3752 'New is FALSE for not new element' => [
3757 'New is TRUE for not new element compared to FALSE' => [
3762 'Version is TRUE for versioned row' => [
3770 'Version is TRUE for not versioned row compared with FALSE' => [
3778 'Version is TRUE for NULL row compared with TRUE' => [
3786 'Single condition with AND compares to TRUE if the one is OK' => [
3789 'FIELD:testField:>:9',
3797 'Multiple conditions with AND compare to TRUE if all are OK' => [
3800 'FIELD:testField:>:9',
3801 'FIELD:testField:<:11',
3809 'Multiple conditions with AND compare to FALSE if one fails' => [
3812 'FIELD:testField:>:9',
3813 'FIELD:testField:<:11',
3821 'Single condition with OR compares to TRUE if the one is OK' => [
3824 'FIELD:testField:>:9',
3832 'Multiple conditions with OR compare to TRUE if one is OK' => [
3835 'FIELD:testField:<:9',
3836 'FIELD:testField:<:11',
3844 'Multiple conditions with OR compare to FALSE is all fail' => [
3847 'FIELD:testField:<:9',
3848 'FIELD:testField:<:11',
3856 'Multiple nested conditions evaluate to TRUE' => [
3859 'FIELD:testField:>:9',
3861 'FIELD:testField:<:100',
3862 'FIELD:testField:>:-100',
3871 'Multiple nested conditions evaluate to FALSE' => [
3874 'FIELD:testField:>:9',
3876 'FIELD:testField:<:100',
3877 'FIELD:testField:>:-100',
3882 'testField' => -999,
3899 'databaseRow' => $record,
3903 'displayCond' => $condition,
3912 $backendUserAuthenticationProphecy = $this->prophesize(BackendUserAuthentication::class);
3913 $GLOBALS[
'BE_USER'] = $backendUserAuthenticationProphecy->reveal();
3916 if ($expectedResult) {
3918 unset($expected[
'processedTca'][
'columns'][
'testField'][
'displayCond']);
3920 unset($expected[
'processedTca'][
'columns'][
'testField']);
3938 'displayCond' => $condition,
3947 $input[
'databaseRow'] = $record;
3948 if (!empty($record[
'testField'])) {
3949 $input[
'databaseRow'] = [
3951 'key' => $record[
'testField'],
3956 $backendUserAuthenticationProphecy = $this->prophesize(BackendUserAuthentication::class);
3957 $GLOBALS[
'BE_USER'] = $backendUserAuthenticationProphecy->reveal();
3960 if ($expectedResult) {
3962 unset($expected[
'processedTca'][
'columns'][
'testField'][
'displayCond']);
3964 unset($expected[
'processedTca'][
'columns'][
'testField']);
3975 'databaseRow' => [],
3979 'displayCond' =>
'HIDE_FOR_NON_ADMINS',
3989 $backendUserProphecy = $this->prophesize(BackendUserAuthentication::class);
3990 $GLOBALS[
'BE_USER'] = $backendUserProphecy->reveal();
3991 $backendUserProphecy->isAdmin()->shouldBeCalled()->willReturn(
true);
3994 unset($expected[
'processedTca'][
'columns'][
'aField'][
'displayCond']);
4005 'databaseRow' => [],
4009 'displayCond' =>
'HIDE_FOR_NON_ADMINS',
4019 $backendUserProphecy = $this->prophesize(BackendUserAuthentication::class);
4020 $GLOBALS[
'BE_USER'] = $backendUserProphecy->reveal();
4021 $backendUserProphecy->isAdmin()->shouldBeCalled()->willReturn(
false);
4024 unset($expected[
'processedTca'][
'columns'][
'aField']);