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