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