TYPO3 CMS  TYPO3_7-6
ActionTest.php
Go to the documentation of this file.
1 <?php
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 
21 {
25  protected $assertionDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/';
26 
35  public function createParentContent()
36  {
37  parent::createParentContent();
38  $this->assertAssertionDataSet('createParentContent');
39 
40  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
41  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
42  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
43  }
44 
49  public function modifyParentContent()
50  {
51  parent::modifyParentContent();
52  $this->assertAssertionDataSet('modifyParentContent');
53 
54  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->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 
66  public function deleteParentContent()
67  {
68  parent::deleteParentContent();
69  $this->assertAssertionDataSet('deleteParentContent');
70 
71  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
72  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
73  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
74  }
75 
81  {
82  parent::deleteParentContentAndDiscardDeletedParent();
83  $this->assertAssertionDataSet('deleteParentContentNDiscardDeletedParent');
84 
85  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
86  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
87  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
88  }
89 
94  public function copyParentContent()
95  {
96  parent::copyParentContent();
97  $this->assertAssertionDataSet('copyParentContent');
98 
99  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
100  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
101  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
102  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
103  }
104 
110  {
111  parent::copyParentContentToDifferentPage();
112  $this->assertAssertionDataSet('copyParentContentToDifferentPage');
113 
114  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
115  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
116  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
117  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
118  }
119 
125  {
126  parent::localizeParentContentInKeepMode();
127  $this->assertAssertionDataSet('localizeParentContentKeep');
128 
129  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
130  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
131  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
132  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
133  }
134 
140  {
141  parent::localizeParentContentWithAllChildrenInKeepMode();
142  $this->assertAssertionDataSet('localizeParentContentWAllChildrenKeep');
143 
144  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
145  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
146  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
147  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
148  }
149 
155  {
156  parent::localizeParentContentInSelectMode();
157  $this->assertAssertionDataSet('localizeParentContentSelect');
158 
159  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
160  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
161  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
162  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
163  }
164 
170  {
171  parent::localizeParentContentWithAllChildrenInSelectMode();
172  $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelect');
173 
174  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
175  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
176  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
177  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
178  }
179 
184  public function changeParentContentSorting()
185  {
186  parent::changeParentContentSorting();
187  $this->assertAssertionDataSet('changeParentContentSorting');
188 
189  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
190  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
191  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
192  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
193  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
194  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
195  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
196  }
197 
203  {
204  parent::moveParentContentToDifferentPage();
205  $this->assertAssertionDataSet('moveParentContentToDifferentPage');
206 
207  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
208  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
209  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
210  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
211  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
212  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
213  }
214 
220  {
221  parent::moveParentContentToDifferentPageAndChangeSorting();
222  $this->assertAssertionDataSet('moveParentContentToDifferentPageNChangeSorting');
223 
224  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
225  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
226  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2', 'Regular Element #1'));
227  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
228  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
229  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
230  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
231  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
232  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
233  }
234 
243  public function modifyPage()
244  {
245  parent::modifyPage();
246  $this->assertAssertionDataSet('modifyPage');
247 
248  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
249  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
250  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
251  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
252  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
253  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
254  }
255 
260  public function deletePage()
261  {
262  parent::deletePage();
263  $this->assertAssertionDataSet('deletePage');
264 
265  $response = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId, false);
266  $this->assertContains('RuntimeException', $response->getError());
267  }
268 
273  public function copyPage()
274  {
275  parent::copyPage();
276  $this->assertAssertionDataSet('copyPage');
277 
278  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
279  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
280  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
281  }
282 
288  {
289  parent::copyPageWithHotelBeforeParentContent();
290  $this->assertAssertionDataSet('copyPageWHotelBeforeParentContent');
291 
292  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
293  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
294  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
295  }
296 
306  {
307  parent::createParentContentWithHotelAndOfferChildren();
308  $this->assertAssertionDataSet('createParentContentNHotelNOfferChildren');
309 
310  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
311  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
312  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
313  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
314  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
315  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
316  }
317 
323  {
324  parent::createAndCopyParentContentWithHotelAndOfferChildren();
325  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildren');
326 
327  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
328  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
329  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
330  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
331  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
332  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
333  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
334  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentHotel)
335  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
336  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
337  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['copiedHotelId'])->setRecordField(self::FIELD_HotelOffer)
338  ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1'));
339  }
340 
346  {
347  parent::createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent();
348  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildrenNDiscardCopiedParent');
349 
350  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
351  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
352  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
353  }
354 
360  {
361  parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
362  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
363 
364  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
365  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
366  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
367  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
368  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
369  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
370  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
371  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
372  ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
373  }
374 
380  {
381  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration();
382  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenWOSortBy');
383 
384  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
385  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
386  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
387  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
388  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
389  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
390  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
391  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
392  ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
393  }
394 
400  {
401  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent();
402  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardCreatedParent');
403 
404  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
405  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
406  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', '[Translate to Dansk:] Testing #1'));
407  }
408 
414  {
415  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent();
416  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardLocalizedParent');
417 
418  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
419  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
420  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
421  }
422 
427  public function modifyOnlyHotelChild()
428  {
429  parent::modifyOnlyHotelChild();
430  $this->assertAssertionDataSet('modifyOnlyHotelChild');
431 
432  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
433  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
434  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
435  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
436  }
437 
443  {
444  parent::modifyParentAndChangeHotelChildrenSorting();
445  $this->assertAssertionDataSet('modifyParentNChangeHotelChildrenSorting');
446 
447  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
448  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
449  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
450  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2', 'Hotel #1'));
451  }
452 
457  public function modifyParentWithHotelChild()
458  {
459  parent::modifyParentWithHotelChild();
460  $this->assertAssertionDataSet('modifyParentNHotelChild');
461 
462  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
463  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
464  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
465  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
466  }
467 
473  {
474  parent::modifyParentWithHotelChildAndDiscardModifiedParent();
475  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardModifiedParent');
476 
477  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
478  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
479  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
480  // Discarding the parent shall not discard the child records
481  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
482  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
483  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
484  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
485  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
486  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
487  }
488 
494  {
495  parent::modifyParentWithHotelChildAndDiscardAll();
496  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardAll');
497 
498  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
499  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
500  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
501  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
502  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
503  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
504  }
505 
511  {
512  parent::modifyParentAndAddHotelChild();
513  $this->assertAssertionDataSet('modifyParentNAddHotelChild');
514 
515  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
516  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
517  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
518  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
519  }
520 
526  {
527  parent::modifyParentAndDeleteHotelChild();
528  $this->assertAssertionDataSet('modifyParentNDeleteHotelChild');
529 
530  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
531  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
532  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
533  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
534  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
535  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
536  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
537  }
538 
544  {
545  parent::modifyAndDiscardAndModifyParentWithHotelChild();
546  $this->assertAssertionDataSet('modifyNDiscardNModifyParentWHotelChild');
547 
548  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
549  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
550  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
551  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
552  ->setTable(self::TABLE_Hotel)->setField('header')->setValues('Testing #1'));
553  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
554  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #2'));
555  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
556  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #2'));
557  }
558 }
getFrontendResponse($pageId, $languageId=0, $backendUserId=0, $workspaceId=0, $failOnFailure=true, $frontendUserId=0)