From 6c9509d11ffa2c2d0d368888b2dfd4d6bbeac435 Mon Sep 17 00:00:00 2001 From: Morton Jonuschat <m.jonuschat@mojocode.de> Date: Fri, 18 Dec 2015 21:38:35 +0100 Subject: [PATCH] [TASK] FormEngine: Test FlexForm sheet displayCond with logical operator Add unit test to test that logical operator work in displayCond at the level of FlexForm sheets. Resolves: #68989 Releases: master Change-Id: I2f6d7359ee742a8738c2aaacf41193c506bdad82 Reviewed-on: https://review.typo3.org/45366 Reviewed-by: Andreas Fernandez <typo3@scripting-base.de> Tested-by: Andreas Fernandez <typo3@scripting-base.de> Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl> Tested-by: Wouter Wolters <typo3@wouterwolters.nl> --- .../EvaluateDisplayConditionsTest.php | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateDisplayConditionsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateDisplayConditionsTest.php index 609d4cf8589f..70e6b3113b68 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateDisplayConditionsTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/EvaluateDisplayConditionsTest.php @@ -855,4 +855,71 @@ class EvaluateDisplayConditionsTest extends UnitTestCase unset($expected['processedTca']['columns']['testField']['config']['ds']['sheets']['sTest']); $this->assertSame($expected, $this->subject->addData($input)); } + + /** + * @test + */ + public function matchFlexformSheetConditionStringsWithLogicalOperatorForFieldsWithDotInName() + { + $input = [ + 'databaseRow' => [ + 'foo' => 'bar', + 'testField' => [ + 'data' => [ + 'sDEF' => [ + 'lDEF' => [ + 'testField' => [ + 'vDEF' => [ + 0 => '', + ], + ], + ], + ], + ], + ], + ], + 'processedTca' => [ + 'columns' => [ + 'testField' => [ + 'config' => [ + 'type' => 'flex', + 'ds' => [ + 'meta' => [], + 'sheets' => [ + 'sDEF' => [ + 'ROOT' => [ + 'type' => 'array', + 'el' => [ + 'testField' => [ + 'config' => [ + 'type' => 'input', + ], + ], + ], + ], + ], + 'sTest' => [ + 'ROOT' => [ + 'type' => 'array', + 'el' => [], + 'sheetTitle' => 'sVideo', + 'displayCond' => [ + 'OR' => [ + 'FIELD:sDEF.testField:=:LIST', + 'FIELD:sDEF.testField:REQ:false', + ], + ] , + ], + ], + ] + ], + ], + ], + ], + ], + ]; + + $expected = $input; + $this->assertSame($expected, $this->subject->addData($input)); + } } -- GitLab