/** * @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)); }
/** * @param string $condition * @param array $record * @param string $expectedResult * @dataProvider flexformConditionStringDataProvider * @test */ public function matchFlexformConditionStrings($condition, array $record, $expectedResult) { $input = ['databaseRow' => $record, 'processedTca' => ['columns' => ['testField' => ['config' => ['type' => 'flex', 'ds' => ['meta' => [], 'sheets' => ['sDEF' => ['ROOT' => ['type' => 'array', 'el' => ['flexTestField' => ['displayCond' => $condition, 'config' => ['type' => 'input']]]]]]]]]]]]; $expected = $input; if (!$expectedResult) { unset($expected['processedTca']['columns']['testField']['config']['ds']['sheets']['sDEF']['ROOT']['el']['flexTestField']); } $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)); }