[BUGFIX] Allow processing of multiple new record localizations
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Functional / DataHandling / IRRE / ForeignField / Modify / ActionTest.php
1 <?php
2 namespace TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\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\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase
21 {
22 /**
23 * @var string
24 */
25 protected $assertionDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/';
26
27 /**
28 * Parent content records
29 */
30
31 /**
32 * @test
33 * @see DataSet/createParentContentRecord.csv
34 */
35 public function createParentContent()
36 {
37 parent::createParentContent();
38 $this->assertAssertionDataSet('createParentContent');
39
40 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
41 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
42 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
43 }
44
45 /**
46 * @test
47 * @see DataSet/modifyParentContentRecord.csv
48 */
49 public function modifyParentContent()
50 {
51 parent::modifyParentContent();
52 $this->assertAssertionDataSet('modifyParentContent');
53
54 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
55 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
56 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
57 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
58 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
59 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
60 }
61
62 /**
63 * @test
64 * @see DataSet/deleteParentContentRecord.csv
65 */
66 public function deleteParentContent()
67 {
68 parent::deleteParentContent();
69 $this->assertAssertionDataSet('deleteParentContent');
70
71 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
72 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
73 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
74 }
75
76 /**
77 * @test
78 * @see DataSet/copyParentContentRecord.csv
79 */
80 public function copyParentContent()
81 {
82 parent::copyParentContent();
83 $this->assertAssertionDataSet('copyParentContent');
84
85 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
86 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
87 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
88 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
89 }
90
91 /**
92 * @test
93 * @see DataSet/copyParentContentToDifferentPage.csv
94 */
95 public function copyParentContentToDifferentPage()
96 {
97 parent::copyParentContentToDifferentPage();
98 $this->assertAssertionDataSet('copyParentContentToDifferentPage');
99
100 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget)->getResponseSections('Default', 'Extbase:list()');
101 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
102 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
103 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
104 }
105
106 /**
107 * @test
108 * @see DataSet/copyParentContentToLanguageKeep.csv
109 */
110 public function copyParentContentToLanguageInKeepMode()
111 {
112 parent::copyParentContentToLanguageInKeepMode();
113 $this->assertAssertionDataSet('copyParentContentToLanguageKeep');
114
115 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
116 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
117 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
118 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
119 }
120
121 /**
122 * @test
123 * @see DataSet/copyParentContentToLanguageWAllChildrenKeep.csv
124 */
125 public function copyParentContentToLanguageWithAllChildrenInKeepMode()
126 {
127 parent::copyParentContentToLanguageWithAllChildrenInKeepMode();
128 $this->assertAssertionDataSet('copyParentContentToLanguageWAllChildrenKeep');
129
130 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
131 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
132 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
133 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
134 }
135
136 /**
137 * @test
138 * @see DataSet/copyParentContentToLanguageSelect.csv
139 */
140 public function copyParentContentToLanguageInSelectMode()
141 {
142 parent::copyParentContentToLanguageInSelectMode();
143 $this->assertAssertionDataSet('copyParentContentToLanguageSelect');
144
145 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
146 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
147 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
148 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
149 }
150
151 /**
152 * @test
153 * @see DataSet/copyParentContentToLanguageWAllChildrenSelect.csv
154 */
155 public function copyParentContentToLanguageWithAllChildrenInSelectMode()
156 {
157 parent::copyParentContentToLanguageWithAllChildrenInSelectMode();
158 $this->assertAssertionDataSet('copyParentContentToLanguageWAllChildrenSelect');
159
160 $this->setUpFrontendRootPage(1, [
161 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
162 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/ExtbaseJsonRenderer.ts',
163 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.ts'
164 ]);
165 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
166 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
167 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentHotel)
168 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
169 }
170
171 /**
172 * @test
173 * @see DataSet/localizeParentContentKeep.csv
174 */
175 public function localizeParentContentInKeepMode()
176 {
177 parent::localizeParentContentInKeepMode();
178 $this->assertAssertionDataSet('localizeParentContentKeep');
179
180 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
181 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
182 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
183 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
184 }
185
186 /**
187 * @test
188 * @see DataSet/localizeParentContentWAllChildrenKeep.csv
189 */
190 public function localizeParentContentWithAllChildrenInKeepMode()
191 {
192 parent::localizeParentContentWithAllChildrenInKeepMode();
193 $this->assertAssertionDataSet('localizeParentContentWAllChildrenKeep');
194
195 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
196 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
197 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
198 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
199 }
200
201 /**
202 * @test
203 * @see DataSet/localizeParentContentSelect.csv
204 */
205 public function localizeParentContentInSelectMode()
206 {
207 parent::localizeParentContentInSelectMode();
208 $this->assertAssertionDataSet('localizeParentContentSelect');
209
210 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
211 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
212 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
213 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
214 }
215
216 /**
217 * @test
218 * @see DataSet/localizeParentContentSelectWSynchronization.csv
219 */
220 public function localizeParentContentInSelectModeWithLanguageSynchronization()
221 {
222 parent::localizeParentContentInSelectModeWithLanguageSynchronization();
223 $this->assertAssertionDataSet('localizeParentContentSelectWSynchronization');
224
225 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
226 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
227 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
228 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
229 }
230
231 /**
232 * @test
233 * @see DataSet/localizeParentContentWAllChildrenSelect.csv
234 */
235 public function localizeParentContentWithAllChildrenInSelectMode()
236 {
237 parent::localizeParentContentWithAllChildrenInSelectMode();
238 $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelect');
239
240 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
241 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
242 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
243 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
244 }
245
246 /**
247 * @test
248 * @see DataSet/localizeParentContentWAllChildrenSelectNLanguageSynchronization.csv
249 */
250 public function localizeParentContentWithAllChildrenInSelectModeAndLanguageSynchronization()
251 {
252 parent::localizeParentContentWithAllChildrenInSelectModeAndLanguageSynchronization();
253 $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelectNLanguageSynchronization');
254
255 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
256 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
257 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
258 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1', '[Translate to Dansk:] Hotel #2'));
259 }
260
261 /**
262 * @test
263 * @see DataSet/localizeParentContentChainWAllChildrenSelectNLanguageSynchronizationSource.csv
264 */
265 public function localizeParentContentChainWithAllChildrenInSelectModeAndLanguageSynchronizationSource()
266 {
267 parent::localizeParentContentChainWithAllChildrenInSelectModeAndLanguageSynchronizationSource();
268 $this->assertAssertionDataSet('localizeParentContentChainWAllChildrenSelectNLanguageSynchronizationSource');
269
270 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond)->getResponseSections('Default', 'Extbase:list()');
271 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
272 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
273 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Hotel #1', '[Translate to Deutsch:] [Translate to Dansk:] Hotel #2'));
274 }
275
276 /**
277 * @test
278 * @see DataSet/Modify/localizeParentContentNCreateNestedChildrenWLanguageSynchronization.csv
279 */
280 public function localizeParentContentAndCreateNestedChildrenWithLanguageSynchronization()
281 {
282 parent::localizeParentContentAndCreateNestedChildrenWithLanguageSynchronization();
283 $this->assertAssertionDataSet('localizeParentContentNCreateNestedChildrenWLanguageSynchronization');
284
285 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
286 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
287 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
288 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1', '[Translate to Dansk:] New Hotel #1'));
289 }
290
291 /**
292 * @test
293 * @see DataSet/changeParentContentRecordSorting.csv
294 */
295 public function changeParentContentSorting()
296 {
297 parent::changeParentContentSorting();
298 $this->assertAssertionDataSet('changeParentContentSorting');
299
300 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
301 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
302 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
303 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
304 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
305 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
306 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
307 }
308
309 /**
310 * @test
311 * @see DataSet/moveParentContentRecordToDifferentPage.csv
312 */
313 public function moveParentContentToDifferentPage()
314 {
315 parent::moveParentContentToDifferentPage();
316 $this->assertAssertionDataSet('moveParentContentToDifferentPage');
317
318 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget)->getResponseSections('Default', 'Extbase:list()');
319 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
320 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
321 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
322 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
323 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
324 }
325
326 /**
327 * @test
328 * @see DataSet/moveParentContentRecordToDifferentPageAndChangeSorting.csv
329 */
330 public function moveParentContentToDifferentPageAndChangeSorting()
331 {
332 parent::moveParentContentToDifferentPageAndChangeSorting();
333 $this->assertAssertionDataSet('moveParentContentToDifferentPageNChangeSorting');
334
335 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget)->getResponseSections('Default', 'Extbase:list()');
336 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
337 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2', 'Regular Element #1'));
338 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
339 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
340 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
341 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
342 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
343 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
344 }
345
346 /**
347 * Page records
348 */
349
350 /**
351 * @test
352 * @see DataSet/modifyPageRecord.csv
353 */
354 public function modifyPage()
355 {
356 parent::modifyPage();
357 $this->assertAssertionDataSet('modifyPage');
358
359 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
360 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
361 ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
362 }
363
364 /**
365 * @test
366 * @see DataSet/deletePageRecord.csv
367 */
368 public function deletePage()
369 {
370 parent::deletePage();
371 $this->assertAssertionDataSet('deletePage');
372
373 $response = $this->getFrontendResponse(self::VALUE_PageId, 0, 0, 0, false);
374 $this->assertContains('PageNotFoundException', $response->getError());
375 }
376
377 /**
378 * @test
379 * @see DataSet/copyPageRecord.csv
380 */
381 public function copyPage()
382 {
383 parent::copyPage();
384 $this->assertAssertionDataSet('copyPage');
385
386 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseSections('Default', 'Extbase:list()');
387 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
388 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
389 }
390
391 /**
392 * @test
393 * @see DataSet/copyPageWHotelBeforeParentContent.csv
394 */
395 public function copyPageWithHotelBeforeParentContent()
396 {
397 parent::copyPageWithHotelBeforeParentContent();
398 $this->assertAssertionDataSet('copyPageWHotelBeforeParentContent');
399
400 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseSections('Default', 'Extbase:list()');
401 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
402 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
403 }
404
405 /**
406 * IRRE Child Records
407 */
408
409 /**
410 * @test
411 * @see DataSet/createParentContentRecordWithHotelAndOfferChildRecords.csv
412 */
413 public function createParentContentWithHotelAndOfferChildren()
414 {
415 parent::createParentContentWithHotelAndOfferChildren();
416 $this->assertAssertionDataSet('createParentContentNHotelNOfferChildren');
417
418 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
419 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
420 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
421 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
422 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
423 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
424 }
425
426 /**
427 * @test
428 * @see DataSet/createAndCopyParentContentRecordWithHotelAndOfferChildRecords.csv
429 */
430 public function createAndCopyParentContentWithHotelAndOfferChildren()
431 {
432 parent::createAndCopyParentContentWithHotelAndOfferChildren();
433 $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildren');
434
435 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
436 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
437 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
438 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
439 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
440 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentHotel)
441 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
442 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
443 ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['copiedHotelId'])->setRecordField(self::FIELD_HotelOffer)
444 ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1'));
445 }
446
447 /**
448 * @test
449 * @see DataSet/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecords.csv
450 */
451 public function createAndLocalizeParentContentWithHotelAndOfferChildren()
452 {
453 parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
454 $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
455
456 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
457 // Content record gets overlaid, thus using newContentId
458 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
459 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
460 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
461 // Hotel record gets overlaid, thus using newHotelId
462 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
463 ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
464 ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
465 }
466
467 /**
468 * @test
469 * @see DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv
470 */
471 public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration()
472 {
473 parent::createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration();
474 $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenWOSortBy');
475
476 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
477 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
478 ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
479 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
480 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
481 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
482 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
483 ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
484 ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
485 }
486
487 /**
488 * @test
489 * @see DataSet/modifyOnlyHotelChildRecord.csv
490 */
491 public function modifyOnlyHotelChild()
492 {
493 parent::modifyOnlyHotelChild();
494 $this->assertAssertionDataSet('modifyOnlyHotelChild');
495
496 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
497 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
498 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
499 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
500 }
501
502 /**
503 * @test
504 * @see DataSet/modifyParentRecordAndChangeHotelChildRecordsSorting.csv
505 */
506 public function modifyParentAndChangeHotelChildrenSorting()
507 {
508 parent::modifyParentAndChangeHotelChildrenSorting();
509 $this->assertAssertionDataSet('modifyParentNChangeHotelChildrenSorting');
510
511 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
512 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
513 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
514 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2', 'Hotel #1'));
515 }
516
517 /**
518 * @test
519 * @see DataSet/modifyParentRecordWithHotelChildRecord.csv
520 */
521 public function modifyParentWithHotelChild()
522 {
523 parent::modifyParentWithHotelChild();
524 $this->assertAssertionDataSet('modifyParentNHotelChild');
525
526 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
527 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
528 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
529 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
530 }
531
532 /**
533 * @test
534 * @see DataSet/modifyParentRecordAndAddHotelChildRecord.csv
535 */
536 public function modifyParentAndAddHotelChild()
537 {
538 parent::modifyParentAndAddHotelChild();
539 $this->assertAssertionDataSet('modifyParentNAddHotelChild');
540
541 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
542 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
543 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
544 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
545 }
546
547 /**
548 * @test
549 * @see DataSet/modifyParentRecordAndDeleteHotelChildRecord.csv
550 */
551 public function modifyParentAndDeleteHotelChild()
552 {
553 parent::modifyParentAndDeleteHotelChild();
554 $this->assertAssertionDataSet('modifyParentNDeleteHotelChild');
555
556 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
557 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
558 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
559 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
560 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
561 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
562 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
563 }
564
565 /**
566 * @test
567 * @see DataSet/localizePageWExclude.csv
568 */
569 public function localizePageWithLocalizationExclude()
570 {
571 parent::localizePageWithLocalizationExclude();
572 $this->assertAssertionDataSet('localizePageWExclude');
573
574 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
575 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
576 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
577 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0'));
578 }
579
580 /**
581 * @test
582 * @see DataSet/localizePageNAddHotelChildWExclude.csv
583 */
584 public function localizePageAndAddHotelChildWithLocalizationExclude()
585 {
586 parent::localizePageAndAddHotelChildWithLocalizationExclude();
587 $this->assertAssertionDataSet('localizePageNAddHotelChildWExclude');
588
589 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
590 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
591 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
592 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0', 'Hotel #007'));
593 }
594
595 /**
596 * @test
597 * @see DataSet/localizePageWSynchronization.csv
598 */
599 public function localizePageWithLanguageSynchronization()
600 {
601 parent::localizePageWithLanguageSynchronization();
602 $this->assertAssertionDataSet('localizePageWSynchronization');
603
604 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
605 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
606 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
607 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #0'));
608 }
609
610 /**
611 * @test
612 * @see DataSet/localizePageNAddHotelChildWSynchronization.csv
613 */
614 public function localizePageAndAddHotelChildWithLanguageSynchronization()
615 {
616 parent::localizePageAndAddHotelChildWithLanguageSynchronization();
617 $this->assertAssertionDataSet('localizePageNAddHotelChildWSynchronization');
618
619 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
620 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
621 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
622 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #0', '[Translate to Dansk:] Hotel #007'));
623 }
624
625 /**
626 * @test
627 * @see DataSet/localizePageNAddMonoglotHotelChildWSynchronization.csv
628 */
629 public function localizePageAndAddMonoglotHotelChildWithLanguageSynchronization()
630 {
631 parent::localizePageAndAddMonoglotHotelChildWithLanguageSynchronization();
632 $this->assertAssertionDataSet('localizePageNAddMonoglotHotelChildWSynchronization');
633
634 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
635 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
636 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
637 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0', 'Hotel #007'));
638 }
639
640 /**
641 * @test
642 * @see DataSet/localizeNCopyPageWSynchronization.csv
643 */
644 public function localizeAndCopyPageWithLanguageSynchronization()
645 {
646 parent::localizeAndCopyPageWithLanguageSynchronization();
647 $this->assertAssertionDataSet('localizeNCopyPageWSynchronization');
648
649 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
650 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
651 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
652 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #0'));
653 }
654
655 /**
656 * @test
657 * @see DataSet/localizePageAddMonoglotHotelChildNCopyPageWSynchronization.csv
658 */
659 public function localizePageAddMonoglotHotelChildAndCopyPageWithLanguageSynchronization()
660 {
661 parent::localizePageAndAddMonoglotHotelChildWithLanguageSynchronization();
662 parent::copyPage();
663 $this->assertAssertionDataSet('localizePageAddMonoglotHotelChildNCopyPageWSynchronization');
664
665 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
666 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
667 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
668 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0', 'Hotel #007'));
669 }
670 }