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/Publish/DataSet/';
26 
35  public function createParentContent()
36  {
37  parent::createParentContent();
38  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
39  $this->assertAssertionDataSet('createParentContent');
40 
41  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
42  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
43  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
44  }
45 
50  public function modifyParentContent()
51  {
52  parent::modifyParentContent();
53  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
54  $this->assertAssertionDataSet('modifyParentContent');
55 
56  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
57  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
58  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
59  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
60  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
61  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
62  }
63 
68  public function deleteParentContent()
69  {
70  parent::deleteParentContent();
71  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
72  $this->assertAssertionDataSet('deleteParentContent');
73 
74  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
75  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
76  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
77  }
78 
84  {
85  parent::deleteParentContentAndDiscardDeletedParent();
86  // Actually this is not required, since there's nothing to publish... but it's a test case!
87  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast, false);
88  $this->assertAssertionDataSet('deleteParentContentNDiscardDeletedParent');
89 
90  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
91  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
92  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
93  }
94 
99  public function copyParentContent()
100  {
101  parent::copyParentContent();
102  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
103  $this->assertAssertionDataSet('copyParentContent');
104 
105  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
106  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
107  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
108  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
109  }
110 
116  {
117  parent::copyParentContentToDifferentPage();
118  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
119  $this->assertAssertionDataSet('copyParentContentToDifferentPage');
120 
121  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections('Default', 'Extbase:list()');
122  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
123  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
124  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
125  }
126 
132  {
133  parent::localizeParentContentInKeepMode();
134  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
135  $this->assertAssertionDataSet('localizeParentContentKeep');
136 
137  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
138  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
139  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
140  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
141  }
142 
148  {
149  parent::localizeParentContentWithAllChildrenInKeepMode();
150  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
151  $this->assertAssertionDataSet('localizeParentContentWAllChildrenKeep');
152 
153  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
154  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
155  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
156  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
157  }
158 
164  {
165  parent::localizeParentContentInSelectMode();
166  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
167  $this->assertAssertionDataSet('localizeParentContentSelect');
168 
169  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
170  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
171  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
172  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
173  }
174 
180  {
181  parent::localizeParentContentWithAllChildrenInSelectMode();
182  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
183  $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelect');
184 
185  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
186  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
187  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
188  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
189  }
190 
195  public function changeParentContentSorting()
196  {
197  parent::changeParentContentSorting();
198  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
199  $this->assertAssertionDataSet('changeParentContentSorting');
200 
201  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
202  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
203  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
204  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
205  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
206  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
207  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
208  }
209 
215  {
216  parent::moveParentContentToDifferentPage();
217  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
218  $this->assertAssertionDataSet('moveParentContentToDifferentPage');
219 
220  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections('Default', 'Extbase:list()');
221  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
222  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
223 
224  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
225  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
226  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
227  }
228 
234  {
235  parent::moveParentContentToDifferentPageAndChangeSorting();
236  $this->actionService->publishRecords(
237  [
238  self::TABLE_Content => [self::VALUE_ContentIdFirst, self::VALUE_ContentIdLast],
239  ]
240  );
241  $this->assertAssertionDataSet('moveParentContentToDifferentPageNChangeSorting');
242 
243  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections('Default', 'Extbase:list()');
244  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
245  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2', 'Regular Element #1'));
246  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
247  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
248  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
249  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
250  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
251  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
252  }
253 
262  public function modifyPage()
263  {
264  parent::modifyPage();
265  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
266  $this->assertAssertionDataSet('modifyPage');
267 
268  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
269  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
270  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
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  }
275 
280  public function deletePage()
281  {
282  parent::deletePage();
283  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
284  $this->assertAssertionDataSet('deletePage');
285 
286  $response = $this->getFrontendResponse(self::VALUE_PageId, 0, 0, 0, false);
287  $this->assertContains('PageNotFoundException', $response->getError());
288  }
289 
294  public function copyPage()
295  {
296  parent::copyPage();
297  $this->actionService->publishRecords(
298  [
299  self::TABLE_Page => [$this->recordIds['newPageId']],
300  self::TABLE_Content => [$this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']],
301  ]
302  );
303  $this->assertAssertionDataSet('copyPage');
304 
305  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0)->getResponseSections('Default', 'Extbase:list()');
306  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
307  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
308  }
309 
315  {
316  parent::copyPageWithHotelBeforeParentContent();
317  $this->actionService->publishRecords(
318  [
319  self::TABLE_Page => [$this->recordIds['newPageId']],
320  self::TABLE_Content => [$this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']],
321  ]
322  );
323  $this->assertAssertionDataSet('copyPageWHotelBeforeParentContent');
324 
325  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0)->getResponseSections('Default', 'Extbase:list()');
326  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
327  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
328  }
329 
339  {
340  parent::createParentContentWithHotelAndOfferChildren();
341  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
342  $this->assertAssertionDataSet('createParentContentNHotelNOfferChildren');
343 
344  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
345  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
346  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
347  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
348  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
349  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
350  }
351 
357  {
358  parent::createAndCopyParentContentWithHotelAndOfferChildren();
359  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
360  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId']);
361  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildren');
362 
363  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
364  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
365  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
366  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
367  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
368  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
369  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
370  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentHotel)
371  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
372  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
373  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['copiedHotelId'])->setRecordField(self::FIELD_HotelOffer)
374  ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1'));
375  }
376 
382  {
383  parent::createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent();
384  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
385  // Actually this is not required, since there's nothing to publish... but it's a test case!
386  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId'], false);
387  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildrenNDiscardCopiedParent');
388 
389  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
390  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
391  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
392  }
393 
399  {
400  parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
401  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
402  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
403  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
404 
405  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
406  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
407  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
408  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
409  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
410  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
411  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
412  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
413  ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
414  }
415 
421  {
422  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent();
423  // Actually this is not required, since there's nothing to publish... but it's a test case!
424  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId'], false);
425  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardCreatedParent');
426 
427  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
428  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
429  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', '[Translate to Dansk:] Testing #1'));
430  }
431 
437  {
438  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent();
439  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
440  // Actually this is not required, since there's nothing to publish... but it's a test case!
441  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId'], false);
442  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardLocalizedParent');
443 
444  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
445  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
446  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
447  }
448 
453  public function modifyOnlyHotelChild()
454  {
455  parent::modifyOnlyHotelChild();
456  $this->actionService->publishRecord(self::TABLE_Hotel, 4);
457  $this->assertAssertionDataSet('modifyOnlyHotelChild');
458 
459  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
460  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
461  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
462  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
463  }
464 
470  {
471  parent::modifyParentAndChangeHotelChildrenSorting();
472  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
473  $this->assertAssertionDataSet('modifyParentNChangeHotelChildrenSorting');
474 
475  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
476  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
477  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
478  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2', 'Hotel #1'));
479  }
480 
485  public function modifyParentWithHotelChild()
486  {
487  parent::modifyParentWithHotelChild();
488  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
489  $this->assertAssertionDataSet('modifyParentNHotelChild');
490 
491  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
492  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
493  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
494  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
495  }
496 
502  {
503  parent::modifyParentWithHotelChildAndDiscardModifiedParent();
504  // Actually this is not required, since there's nothing to publish... but it's a test case!
505  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, false);
506  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardModifiedParent');
507 
508  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
509  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
510  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
511  // Discarding the parent shall not discard the child records
512  // Since the discarded parent does not need to be published, version children are not published as well
513  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
514  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
515  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
516  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
517  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
518  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #1'));
519  }
520 
526  {
527  parent::modifyParentWithHotelChildAndDiscardAll();
528  // Actually this is not required, since there's nothing to publish... but it's a test case!
529  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, false);
530  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardAll');
531 
532  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
533  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
534  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
535  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
536  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
537  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
538  }
539 
545  {
546  parent::modifyParentAndAddHotelChild();
547  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
548  $this->assertAssertionDataSet('modifyParentNAddHotelChild');
549 
550  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
551  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
552  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
553  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
554  }
555 
561  {
562  parent::modifyParentAndDeleteHotelChild();
563  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
564  $this->assertAssertionDataSet('modifyParentNDeleteHotelChild');
565 
566  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
567  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
568  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
569  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
570  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
571  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
572  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
573  }
574 
580  {
581  parent::modifyAndDiscardAndModifyParentWithHotelChild();
582  $this->actionService->publishRecords(
583  [
584  self::TABLE_Content => [self::VALUE_ContentIdFirst],
585  self::TABLE_Hotel => [3, 4],
586  ]
587  );
588  $this->assertAssertionDataSet('modifyNDiscardNModifyParentWHotelChild');
589 
590  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
591  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
592  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
593  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
594  ->setTable(self::TABLE_Hotel)->setField('header')->setValues('Testing #1'));
595  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
596  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #2'));
597  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
598  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #2'));
599  }
600 }
getFrontendResponse($pageId, $languageId=0, $backendUserId=0, $workspaceId=0, $failOnFailure=true, $frontendUserId=0)