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