TYPO3 CMS  TYPO3_7-6
PageTsConfigMergedTest.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 
19 
24 {
28  protected $subject;
29 
30  protected function setUp()
31  {
32  $this->subject = new PageTsConfigMerged();
33  }
34 
39  {
40  $input = [
41  'tableName' => 'aTable',
42  '' => 'aType',
43  'pageTsConfig' => [
44  'aSetting' => 'aValue',
45  ],
46  ];
47  $expected = $input;
48  $expected['pageTsConfig'] = $input['pageTsConfig'];
49  $this->assertSame($expected, $this->subject->addData($input));
50  }
51 
56  {
57  $input = [
58  'tableName' => 'aTable',
59  'recordTypeValue' => 'aType',
60  'pageTsConfig' => [
61  'TCEFORM.' => [
62  'aTable.' => [
63  'aField.' => [
64  'disabled' => 1,
65  ],
66  ],
67  ],
68  ],
69  ];
70  $expected = $input;
71  $expected['pageTsConfig'] = $input['pageTsConfig'];
72  $this->assertSame($expected, $this->subject->addData($input));
73  }
74 
79  {
80  $input = [
81  'tableName' => 'aTable',
82  'recordTypeValue' => 'aType',
83  'pageTsConfig' => [
84  'TCEFORM.' => [
85  'aTable.' => [
86  'aField.' => [
87  'types.' => [
88  'aType.' => [
89  'disabled' => 1,
90  ],
91  ],
92  ],
93  ],
94  ],
95  ],
96  ];
97  $expected = $input;
98  $expected['pageTsConfig'] = [
99  'TCEFORM.' => [
100  'aTable.' => [
101  'aField.' => [
102  'disabled' => 1,
103  ],
104  ],
105  ],
106  ];
107  $this->assertSame($expected, $this->subject->addData($input));
108  }
109 
114  {
115  $input = [
116  'tableName' => 'aTable',
117  'recordTypeValue' => 'aType',
118  'pageTsConfig' => [
119  'TCEFORM.' => [
120  'aTable.' => [
121  'aField.' => [
122  'disabled' => 0,
123  'types.' => [
124  'aType.' => [
125  'disabled' => 1,
126  ],
127  ],
128  ],
129  ],
130  ],
131  ],
132  ];
133  $expected = $input;
134  $expected['pageTsConfig'] = [
135  'TCEFORM.' => [
136  'aTable.' => [
137  'aField.' => [
138  'disabled' => 1,
139  ],
140  ],
141  ],
142  ];
143  $this->assertSame($expected, $this->subject->addData($input));
144  }
145 }