TYPO3 CMS  TYPO3_7-6
FlexFormToolsTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
23 {
27  public function traverseFlexFormXmlDataRecurseDoesNotFailOnNotExistingField()
28  {
29  $dataStruct = [
30  'dummy_field' => [
31  'TCEforms' => [
32  'config' => [],
33  ],
34  ],
35  ];
36  $pA = [
37  'vKeys' => ['ES'],
38  'callBackMethod_value' => 'dummy',
39  ];
40  $editData = '';
42  $subject = $this->getMock(FlexFormTools::class, ['executeCallBackMethod']);
43  $subject->expects($this->never())->method('executeCallBackMethod');
44  $subject->traverseFlexFormXMLData_recurse($dataStruct, $editData, $pA);
45  }
46 
50  public function traverseFlexFormXmlDataRecurseDoesNotFailOnNotExistingArrayField()
51  {
52  $dataStruct = [
53  'dummy_field' => [
54  'type' => 'array',
55  'el' => 'field_not_in_data',
56  ],
57  ];
58  $pA = [
59  'vKeys' => ['ES'],
60  'callBackMethod_value' => 'dummy',
61  ];
62  $editData = [
63  'field' => [
64  'el' => 'dummy',
65  ],
66  ];
67  $editData2 = '';
69  $subject = $this->getMock(FlexFormTools::class);
70  $this->assertEquals(
71  $subject->traverseFlexFormXMLData_recurse($dataStruct, $editData, $pA),
72  $subject->traverseFlexFormXMLData_recurse($dataStruct, $editData2, $pA)
73  );
74  }
75 }