[BUGFIX] Allow array of paths in psr-4 autoload definition
[Packages/TYPO3.CMS.git] / typo3 / sysext / workspaces / Tests / Functional / DataHandling / ManyToMany / Modify / ActionTest.php
1 <?php
2 namespace TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\Modify;
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
17 /**
18 * Functional test for the DataHandler
19 */
20 class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase
21 {
22 /**
23 * @var string
24 */
25 protected $assertionDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/';
26
27 /**
28 * MM Relations
29 */
30
31 /**
32 * @test
33 * @see DataSet/Assertion/addCategoryRelation.csv
34 */
35 public function addCategoryRelation()
36 {
37 parent::addCategoryRelation();
38 $this->assertAssertionDataSet('addCategoryRelation');
39
40 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
41 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
42 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
43 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category B', 'Category A.A'));
44 }
45
46 /**
47 * @test
48 * @see DataSet/Assertion/deleteCategoryRelation.csv
49 */
50 public function deleteCategoryRelation()
51 {
52 parent::deleteCategoryRelation();
53 $this->assertAssertionDataSet('deleteCategoryRelation');
54
55 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
56 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
57 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
58 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A'));
59 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
60 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
61 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C', 'Category A.A'));
62 }
63
64 /**
65 * @test
66 * @see DataSet/Assertion/changeCategoryRelationSorting.csv
67 */
68 public function changeCategoryRelationSorting()
69 {
70 parent::changeCategoryRelationSorting();
71 $this->assertAssertionDataSet('changeCategoryRelationSorting');
72
73 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
74 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
75 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
76 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category B'));
77 }
78
79 /**
80 * @test
81 * @see DataSet/Assertion/createContentRecordAndAddCategoryRelation.csv
82 */
83 public function createContentAndAddRelation()
84 {
85 parent::createContentAndAddRelation();
86 $this->assertAssertionDataSet('createContentNAddRelation');
87
88 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
89 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
90 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
91 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
92 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField('categories')
93 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B'));
94 }
95
96 /**
97 * @test
98 * @see DataSet/Assertion/createCategoryRecordAndAddCategoryRelation.csv
99 */
100 public function createCategoryAndAddRelation()
101 {
102 parent::createCategoryAndAddRelation();
103 $this->assertAssertionDataSet('createCategoryNAddRelation');
104
105 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
106 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
107 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1'));
108 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
109 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
110 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1'));
111 }
112
113 /**
114 * @test
115 * @see DataSet/Assertion/createContentRecordAndCreateCategoryRelation.csv
116 */
117 public function createContentAndCreateRelation()
118 {
119 parent::createContentAndCreateRelation();
120 $this->assertAssertionDataSet('createContentNCreateRelation');
121
122 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
123 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
124 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
125 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
126 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField('categories')
127 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1'));
128 }
129
130 /**
131 * @test
132 * @see DataSet/Assertion/createCategoryRecordAndCreateCategoryRelation.csv
133 */
134 public function createCategoryAndCreateRelation()
135 {
136 parent::createCategoryAndCreateRelation();
137 $this->assertAssertionDataSet('createCategoryNCreateRelation');
138 }
139
140 /**
141 * @test
142 * @see DataSet/Assertion/modifyCategoryRecordOfCategoryRelation.csv
143 */
144 public function modifyCategoryOfRelation()
145 {
146 parent::modifyCategoryOfRelation();
147 $this->assertAssertionDataSet('modifyCategoryOfRelation');
148
149 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
150 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
151 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
152 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1', 'Category B'));
153 }
154
155 /**
156 * @test
157 * @see DataSet/Assertion/modifyContentRecordOfCategoryRelation.csv
158 */
159 public function modifyContentOfRelation()
160 {
161 parent::modifyContentOfRelation();
162 $this->assertAssertionDataSet('modifyContentOfRelation');
163
164 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
165 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
166 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
167 }
168
169 /**
170 * @test
171 * @see DataSet/Assertion/modifyBothRecordsOfCategoryRelation.csv
172 */
173 public function modifyBothsOfRelation()
174 {
175 parent::modifyBothsOfRelation();
176 $this->assertAssertionDataSet('modifyBothsOfRelation');
177
178 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
179 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
180 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
181 ->setTable(self::TABLE_Category)->setField('title')->setValues('Testing #1', 'Category B'));
182 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
183 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
184 }
185
186 /**
187 * @test
188 * @see DataSet/Assertion/deleteContentRecordOfCategoryRelation.csv
189 */
190 public function deleteContentOfRelation()
191 {
192 parent::deleteContentOfRelation();
193 $this->assertAssertionDataSet('deleteContentOfRelation');
194
195 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
196 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
197 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
198 }
199
200 /**
201 * @test
202 * @see DataSet/Assertion/deleteCategoryRecordOfCategoryRelation.csv
203 */
204 public function deleteCategoryOfRelation()
205 {
206 parent::deleteCategoryOfRelation();
207 $this->assertAssertionDataSet('deleteCategoryOfRelation');
208
209 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
210 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
211 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
212 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A'));
213 }
214
215 /**
216 * @test
217 * @see DataSet/Assertion/copyContentRecordOfCategoryRelation.csv
218 */
219 public function copyContentOfRelation()
220 {
221 parent::copyContentOfRelation();
222 $this->assertAssertionDataSet('copyContentOfRelation');
223
224 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
225 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
226 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField('categories')
227 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
228 }
229
230 /**
231 * @test
232 * @see DataSet/Assertion/copyCategoryRecordOfCategoryRelation.csv
233 */
234 public function copyCategoryOfRelation()
235 {
236 parent::copyCategoryOfRelation();
237 $this->assertAssertionDataSet('copyCategoryOfRelation');
238
239 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
240 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
241 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
242 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category A (copy 1)'));
243 }
244
245 /**
246 * @test
247 * @see DataSet/Assertion/localizeContentRecordOfCategoryRelation.csv
248 */
249 public function localizeContentOfRelation()
250 {
251 parent::localizeContentOfRelation();
252 $this->assertAssertionDataSet('localizeContentOfRelation');
253
254 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
255 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
256 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
257 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
258 }
259
260 /**
261 * @test
262 * @see DataSet/Assertion/localizeCategoryRecordOfCategoryRelation.csv
263 */
264 public function localizeCategoryOfRelation()
265 {
266 parent::localizeCategoryOfRelation();
267 $this->assertAssertionDataSet('localizeCategoryOfRelation');
268
269 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
270 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
271 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField('categories')
272 ->setTable(self::TABLE_Category)->setField('title')->setValues('[Translate to Dansk:] Category A', 'Category B'));
273 }
274
275 /**
276 * @test
277 * @see DataSet/Assertion/moveContentRecordOfCategoryRelationToDifferentPage.csv
278 */
279 public function moveContentOfRelationToDifferentPage()
280 {
281 parent::moveContentOfRelationToDifferentPage();
282 $this->assertAssertionDataSet('moveContentOfRelationToDifferentPage');
283
284 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
285 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
286 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField('categories')
287 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
288 }
289
290 /**
291 * @test
292 * @see DataSet/Assertion/copyPage.csv
293 */
294 public function copyPage()
295 {
296 parent::copyPage();
297 $this->assertAssertionDataSet('copyPage');
298
299 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
300 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
301 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
302 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
303 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
304 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
305 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentIdFirst'])->setRecordField('categories')
306 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category A', 'Category B'));
307 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
308 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentIdLast'])->setRecordField('categories')
309 ->setTable(self::TABLE_Category)->setField('title')->setValues('Category B', 'Category C'));
310 }
311 }