‪TYPO3CMS  11.5
PageTsConfigMergedTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
26 class ‪PageTsConfigMergedTest extends UnitTestCase
27 {
29 
30  protected function ‪setUp(): void
31  {
32  parent::setUp();
33  $this->subject = new ‪PageTsConfigMerged();
34  }
35 
40  {
41  $input = [
42  'tableName' => 'aTable',
43  '' => 'aType',
44  'pageTsConfig' => [
45  'aSetting' => 'aValue',
46  ],
47  ];
48  $expected = $input;
49  $expected['pageTsConfig'] = $input['pageTsConfig'];
50  self::assertSame($expected, $this->subject->addData($input));
51  }
52 
57  {
58  $input = [
59  'tableName' => 'aTable',
60  'recordTypeValue' => 'aType',
61  'pageTsConfig' => [
62  'TCEFORM.' => [
63  'aTable.' => [
64  'aField.' => [
65  'disabled' => 1,
66  ],
67  ],
68  ],
69  ],
70  ];
71  $expected = $input;
72  $expected['pageTsConfig'] = $input['pageTsConfig'];
73  self::assertSame($expected, $this->subject->addData($input));
74  }
75 
80  {
81  $input = [
82  'tableName' => 'aTable',
83  'recordTypeValue' => 'aType',
84  'pageTsConfig' => [
85  'TCEFORM.' => [
86  'aTable.' => [
87  'aField.' => [
88  'types.' => [
89  'aType.' => [
90  'disabled' => 1,
91  ],
92  ],
93  ],
94  ],
95  ],
96  ],
97  ];
98  $expected = $input;
99  $expected['pageTsConfig'] = [
100  'TCEFORM.' => [
101  'aTable.' => [
102  'aField.' => [
103  'disabled' => 1,
104  ],
105  ],
106  ],
107  ];
108  self::assertSame($expected, $this->subject->addData($input));
109  }
110 
115  {
116  $input = [
117  'tableName' => 'aTable',
118  'recordTypeValue' => 'aType',
119  'pageTsConfig' => [
120  'TCEFORM.' => [
121  'aTable.' => [
122  'aField.' => [
123  'disabled' => 0,
124  'types.' => [
125  'aType.' => [
126  'disabled' => 1,
127  ],
128  ],
129  ],
130  ],
131  ],
132  ],
133  ];
134  $expected = $input;
135  $expected['pageTsConfig'] = [
136  'TCEFORM.' => [
137  'aTable.' => [
138  'aField.' => [
139  'disabled' => 1,
140  ],
141  ],
142  ],
143  ];
144  self::assertSame($expected, $this->subject->addData($input));
145  }
146 }
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest
Definition: PageTsConfigMergedTest.php:27
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\$subject
‪PageTsConfigMerged $subject
Definition: PageTsConfigMergedTest.php:28
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\addDataMergesTypeSpecificConfiguration
‪addDataMergesTypeSpecificConfiguration()
Definition: PageTsConfigMergedTest.php:79
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\addDataKeepsTableSpecificConfigurationWithoutType
‪addDataKeepsTableSpecificConfigurationWithoutType()
Definition: PageTsConfigMergedTest.php:56
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\addDataTypeSpecificConfigurationOverwritesMainConfiguration
‪addDataTypeSpecificConfigurationOverwritesMainConfiguration()
Definition: PageTsConfigMergedTest.php:114
‪TYPO3\CMS\Backend\Form\FormDataProvider\PageTsConfigMerged
Definition: PageTsConfigMerged.php:25
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\setUp
‪setUp()
Definition: PageTsConfigMergedTest.php:30
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\PageTsConfigMergedTest\addDataSetsMergedTsConfigToTsConfig
‪addDataSetsMergedTsConfigToTsConfig()
Definition: PageTsConfigMergedTest.php:39
‪TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider
Definition: DatabaseDefaultLanguagePageRowTest.php:18