[FOLLOWUP][TASK] Enhance DataHandler translation and synchronization handling
[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/localizeParentContentWAllChildrenSelect.csv
219 */
220 public function localizeParentContentWithAllChildrenInSelectMode()
221 {
222 parent::localizeParentContentWithAllChildrenInSelectMode();
223 $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelect');
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/localizeParentContentWAllChildrenSelectNLanguageSynchronization.csv
234 */
235 public function localizeParentContentWithAllChildrenInSelectModeAndLanguageSynchronization()
236 {
237 parent::localizeParentContentWithAllChildrenInSelectModeAndLanguageSynchronization();
238 $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelectNLanguageSynchronization');
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', '[Translate to Dansk:] Hotel #2'));
244 }
245
246 /**
247 * @test
248 * @see DataSet/changeParentContentRecordSorting.csv
249 */
250 public function changeParentContentSorting()
251 {
252 parent::changeParentContentSorting();
253 $this->assertAssertionDataSet('changeParentContentSorting');
254
255 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
256 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
257 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
258 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
259 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
260 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
261 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
262 }
263
264 /**
265 * @test
266 * @see DataSet/moveParentContentRecordToDifferentPage.csv
267 */
268 public function moveParentContentToDifferentPage()
269 {
270 parent::moveParentContentToDifferentPage();
271 $this->assertAssertionDataSet('moveParentContentToDifferentPage');
272
273 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget)->getResponseSections('Default', 'Extbase:list()');
274 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
275 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
276 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
277 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
278 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
279 }
280
281 /**
282 * @test
283 * @see DataSet/moveParentContentRecordToDifferentPageAndChangeSorting.csv
284 */
285 public function moveParentContentToDifferentPageAndChangeSorting()
286 {
287 parent::moveParentContentToDifferentPageAndChangeSorting();
288 $this->assertAssertionDataSet('moveParentContentToDifferentPageNChangeSorting');
289
290 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget)->getResponseSections('Default', 'Extbase:list()');
291 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
292 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2', 'Regular Element #1'));
293 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
294 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
295 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
296 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
297 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
298 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
299 }
300
301 /**
302 * Page records
303 */
304
305 /**
306 * @test
307 * @see DataSet/modifyPageRecord.csv
308 */
309 public function modifyPage()
310 {
311 parent::modifyPage();
312 $this->assertAssertionDataSet('modifyPage');
313
314 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
315 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
316 ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
317 }
318
319 /**
320 * @test
321 * @see DataSet/deletePageRecord.csv
322 */
323 public function deletePage()
324 {
325 parent::deletePage();
326 $this->assertAssertionDataSet('deletePage');
327
328 $response = $this->getFrontendResponse(self::VALUE_PageId, 0, 0, 0, false);
329 $this->assertContains('PageNotFoundException', $response->getError());
330 }
331
332 /**
333 * @test
334 * @see DataSet/copyPageRecord.csv
335 */
336 public function copyPage()
337 {
338 parent::copyPage();
339 $this->assertAssertionDataSet('copyPage');
340
341 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseSections('Default', 'Extbase:list()');
342 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
343 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
344 }
345
346 /**
347 * @test
348 * @see DataSet/copyPageWHotelBeforeParentContent.csv
349 */
350 public function copyPageWithHotelBeforeParentContent()
351 {
352 parent::copyPageWithHotelBeforeParentContent();
353 $this->assertAssertionDataSet('copyPageWHotelBeforeParentContent');
354
355 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseSections('Default', 'Extbase:list()');
356 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
357 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
358 }
359
360 /**
361 * IRRE Child Records
362 */
363
364 /**
365 * @test
366 * @see DataSet/createParentContentRecordWithHotelAndOfferChildRecords.csv
367 */
368 public function createParentContentWithHotelAndOfferChildren()
369 {
370 parent::createParentContentWithHotelAndOfferChildren();
371 $this->assertAssertionDataSet('createParentContentNHotelNOfferChildren');
372
373 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
374 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
375 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
376 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
377 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
378 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
379 }
380
381 /**
382 * @test
383 * @see DataSet/createAndCopyParentContentRecordWithHotelAndOfferChildRecords.csv
384 */
385 public function createAndCopyParentContentWithHotelAndOfferChildren()
386 {
387 parent::createAndCopyParentContentWithHotelAndOfferChildren();
388 $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildren');
389
390 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
391 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
392 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
393 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
394 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
395 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentHotel)
396 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
397 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
398 ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['copiedHotelId'])->setRecordField(self::FIELD_HotelOffer)
399 ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1'));
400 }
401
402 /**
403 * @test
404 * @see DataSet/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecords.csv
405 */
406 public function createAndLocalizeParentContentWithHotelAndOfferChildren()
407 {
408 parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
409 $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
410
411 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
412 // Content record gets overlaid, thus using newContentId
413 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
414 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
415 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
416 // Hotel record gets overlaid, thus using newHotelId
417 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
418 ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
419 ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
420 }
421
422 /**
423 * @test
424 * @see DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv
425 */
426 public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration()
427 {
428 parent::createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration();
429 $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenWOSortBy');
430
431 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
432 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
433 ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
434 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
435 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
436 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
437 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
438 ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
439 ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
440 }
441
442 /**
443 * @test
444 * @see DataSet/modifyOnlyHotelChildRecord.csv
445 */
446 public function modifyOnlyHotelChild()
447 {
448 parent::modifyOnlyHotelChild();
449 $this->assertAssertionDataSet('modifyOnlyHotelChild');
450
451 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
452 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
453 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
454 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
455 }
456
457 /**
458 * @test
459 * @see DataSet/modifyParentRecordAndChangeHotelChildRecordsSorting.csv
460 */
461 public function modifyParentAndChangeHotelChildrenSorting()
462 {
463 parent::modifyParentAndChangeHotelChildrenSorting();
464 $this->assertAssertionDataSet('modifyParentNChangeHotelChildrenSorting');
465
466 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
467 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
468 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
469 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2', 'Hotel #1'));
470 }
471
472 /**
473 * @test
474 * @see DataSet/modifyParentRecordWithHotelChildRecord.csv
475 */
476 public function modifyParentWithHotelChild()
477 {
478 parent::modifyParentWithHotelChild();
479 $this->assertAssertionDataSet('modifyParentNHotelChild');
480
481 $responseSections = $this->getFrontendResponse(self::VALUE_PageId)->getResponseSections('Default', 'Extbase:list()');
482 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
483 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
484 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
485 }
486
487 /**
488 * @test
489 * @see DataSet/modifyParentRecordAndAddHotelChildRecord.csv
490 */
491 public function modifyParentAndAddHotelChild()
492 {
493 parent::modifyParentAndAddHotelChild();
494 $this->assertAssertionDataSet('modifyParentNAddHotelChild');
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_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
499 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
500 }
501
502 /**
503 * @test
504 * @see DataSet/modifyParentRecordAndDeleteHotelChildRecord.csv
505 */
506 public function modifyParentAndDeleteHotelChild()
507 {
508 parent::modifyParentAndDeleteHotelChild();
509 $this->assertAssertionDataSet('modifyParentNDeleteHotelChild');
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_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
514 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
515 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
516 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
517 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
518 }
519
520 /**
521 * @test
522 * @see DataSet/localizePageWExclude.csv
523 */
524 public function localizePageWithLocalizationExclude()
525 {
526 parent::localizePageWithLocalizationExclude();
527 $this->assertAssertionDataSet('localizePageWExclude');
528
529 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
530 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
531 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
532 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0'));
533 }
534
535 /**
536 * @test
537 * @see DataSet/localizePageNAddHotelChildWExclude.csv
538 */
539 public function localizePageAndAddHotelChildWithLocalizationExclude()
540 {
541 parent::localizePageAndAddHotelChildWithLocalizationExclude();
542 $this->assertAssertionDataSet('localizePageNAddHotelChildWExclude');
543
544 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
545 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
546 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
547 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0', 'Hotel #007'));
548 }
549
550 /**
551 * @test
552 * @see DataSet/localizePageWSynchronization.csv
553 */
554 public function localizePageWithLanguageSynchronization()
555 {
556 parent::localizePageWithLanguageSynchronization();
557 $this->assertAssertionDataSet('localizePageWSynchronization');
558
559 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
560 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
561 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
562 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #0'));
563 }
564
565 /**
566 * @test
567 * @see DataSet/localizePageNAddHotelChildWSynchronization.csv
568 */
569 public function localizePageAndAddHotelChildWithLanguageSynchronization()
570 {
571 parent::localizePageAndAddHotelChildWithLanguageSynchronization();
572 $this->assertAssertionDataSet('localizePageNAddHotelChildWSynchronization');
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('[Translate to Dansk:] Hotel #0', '[Translate to Dansk:] Hotel #007'));
578 }
579
580 /**
581 * @test
582 * @see DataSet/localizePageNAddMonoglotHotelChildWSynchronization.csv
583 */
584 public function localizePageAndAddMonoglotHotelChildWithLanguageSynchronization()
585 {
586 parent::localizePageAndAddMonoglotHotelChildWithLanguageSynchronization();
587 $this->assertAssertionDataSet('localizePageNAddMonoglotHotelChildWSynchronization');
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/localizeNCopyPageWSynchronization.csv
598 */
599 public function localizeAndCopyPageWithLanguageSynchronization()
600 {
601 parent::localizeAndCopyPageWithLanguageSynchronization();
602 $this->assertAssertionDataSet('localizeNCopyPageWSynchronization');
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/localizePageAddMonoglotHotelChildNCopyPageWSynchronization.csv
613 */
614 public function localizePageAddMonoglotHotelChildAndCopyPageWithLanguageSynchronization()
615 {
616 parent::localizePageAndAddMonoglotHotelChildWithLanguageSynchronization();
617 parent::copyPage();
618 $this->assertAssertionDataSet('localizePageAddMonoglotHotelChildNCopyPageWSynchronization');
619
620 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
621 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
622 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
623 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0', 'Hotel #007'));
624 }
625 }