[TASK] FormEngine: Test display conditions for fields with dot in name 70/44370/3
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Thu, 29 Oct 2015 18:26:17 +0000 (19:26 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 29 Oct 2015 18:42:27 +0000 (19:42 +0100)
Add a unit test that validates that dots in flexform field names are
supported on the sheet level with the FormEngine rewrite.

Resolves: #60339
Releases: master
Change-Id: I7c1e3865a8ba97d815bf4d61c3ba0111ae8b30e6
Reviewed-on: https://review.typo3.org/44370
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateDisplayConditionsTest.php

index f6c07ef..cb13dee 100644 (file)
@@ -763,4 +763,67 @@ class EvaluateDisplayConditionsTest extends UnitTestCase
         }
         $this->assertSame($expected, $this->subject->addData($input));
     }
+
+    /**
+     * @test
+     */
+    public function matchFlexformSheetConditionStringsForFieldsWithDotInName()
+    {
+        $input = [
+            'databaseRow' => [
+                'foo' => 'bar',
+                'testField' => [
+                    'data' => [
+                        'sDEF' => [
+                            'lDEF' => [
+                                'flex.TestField' => [
+                                    'vDEF' => [
+                                        0 => 0,
+                                    ],
+                                ],
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+            'processedTca' => [
+                'columns' => [
+                    'testField' => [
+                        'config' => [
+                            'type' => 'flex',
+                            'ds' => [
+                                'meta' => [],
+                                'sheets' => [
+                                    'sDEF' => [
+                                        'ROOT' => [
+                                            'type' => 'array',
+                                            'el' => [
+                                                'flex.TestField' => [
+                                                    'config' => [
+                                                        'type' => 'input',
+                                                    ],
+                                                ],
+                                            ],
+                                        ],
+                                    ],
+                                    'sTest' => [
+                                        'ROOT' => [
+                                            'type' => 'array',
+                                            'el' => [],
+                                            'sheetTitle' => 'sVideo',
+                                            'displayCond' => 'FIELD:sDEF.flex.TestField:!=:0',
+                                        ],
+                                    ],
+                                ]
+                            ],
+                        ],
+                    ],
+                ],
+            ],
+        ];
+
+        $expected = $input;
+        unset($expected['processedTca']['columns']['testField']['config']['ds']['sheets']['sTest']);
+        $this->assertSame($expected, $this->subject->addData($input));
+    }
 }