TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
workspaces/Tests/Functional/DataHandling/IRRE/CSV/Publish/ActionTest.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\Publish;
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/CSV/Publish/DataSet/';
26 
30  protected function setUp()
31  {
32  parent::setUp();
33  }
34 
39  public function createParentContent()
40  {
41  parent::createParentContent();
42  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
43  $this->assertAssertionDataSet('createParentContent');
44 
45  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
46  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
47  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
48  }
49 
54  public function modifyParentContent()
55  {
56  parent::modifyParentContent();
57  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
58  $this->assertAssertionDataSet('modifyParentContent');
59 
60  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
61  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
62  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
63  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
64  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
65  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
66  }
67 
72  public function deleteParentContent()
73  {
74  parent::deleteParentContent();
75  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
76  $this->assertAssertionDataSet('deleteParentContent');
77 
78  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
79  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
80  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
81  }
82 
88  {
89  parent::deleteParentContentAndDiscardDeletedParent();
90  // Actually this is not required, since there's nothing to publish... but it's a test case!
91  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast, false);
92  $this->assertAssertionDataSet('deleteParentContentNDiscardDeletedParent');
93 
94  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
95  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
96  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
97  }
98 
103  public function copyParentContent()
104  {
105  parent::copyParentContent();
106  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
107  $this->assertAssertionDataSet('copyParentContent');
108 
109  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
110  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
111  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
112  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
113  }
114 
120  {
121  parent::copyParentContentToDifferentPage();
122  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
123  $this->assertAssertionDataSet('copyParentContentToDifferentPage');
124 
125  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections();
126  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
127  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
128  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
129  }
130 
136  {
137  parent::localizeParentContentInKeepMode();
138  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
139  $this->assertAssertionDataSet('localizeParentContentKeep');
140 
141  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
142  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
143  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
144  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
145  }
146 
152  {
153  parent::localizeParentContentWithAllChildrenInKeepMode();
154  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
155  $this->assertAssertionDataSet('localizeParentContentWAllChildrenKeep');
156 
157  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
158  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
159  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
160  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
161  }
162 
168  {
169  parent::localizeParentContentInSelectMode();
170  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
171  $this->assertAssertionDataSet('localizeParentContentSelect');
172 
173  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
174  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
175  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
176  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
177  }
178 
184  {
185  parent::localizeParentContentWithAllChildrenInSelectMode();
186  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
187  $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelect');
188 
189  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
190  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
191  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
192  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
193  }
194 
199  public function changeParentContentSorting()
200  {
201  parent::changeParentContentSorting();
202  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
203  $this->assertAssertionDataSet('changeParentContentSorting');
204 
205  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
206  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
207  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
208  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
209  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
210  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
211  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
212  }
213 
219  {
220  parent::moveParentContentToDifferentPage();
221  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
222  $this->assertAssertionDataSet('moveParentContentToDifferentPage');
223 
224  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections();
225  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
226  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
227  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
228  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
229  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
230  }
231 
237  {
238  parent::moveParentContentToDifferentPageAndChangeSorting();
239  $this->actionService->publishRecords(
240  [
241  self::TABLE_Content => [self::VALUE_ContentIdFirst, self::VALUE_ContentIdLast],
242  ]
243  );
244  $this->assertAssertionDataSet('moveParentContentToDifferentPageNChangeSorting');
245 
246  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections();
247  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
248  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2', 'Regular Element #1'));
249  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
250  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
251  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
252  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
253  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
254  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
255  }
256 
265  public function modifyPage()
266  {
267  parent::modifyPage();
268  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
269  $this->assertAssertionDataSet('modifyPage');
270 
271  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
272  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
273  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
274  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
275  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
276  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
277  }
278 
283  public function deletePage()
284  {
285  parent::deletePage();
286  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
287  $this->assertAssertionDataSet('deletePage');
288 
289  $response = $this->getFrontendResponse(self::VALUE_PageId, 0, 0, 0, false);
290  $this->assertContains('PageNotFoundException', $response->getError());
291  }
292 
297  public function copyPage()
298  {
299  parent::copyPage();
300  $this->actionService->publishRecords(
301  [
302  self::TABLE_Page => [$this->recordIds['newPageId']],
303  self::TABLE_Content => [$this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']],
304  ]
305  );
306  $this->assertAssertionDataSet('copyPage');
307 
308  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0)->getResponseSections();
309  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
310  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
311  }
312 
318  {
319  parent::copyPageWithHotelBeforeParentContent();
320  $this->actionService->publishRecords(
321  [
322  self::TABLE_Page => [$this->recordIds['newPageId']],
323  self::TABLE_Content => [$this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']],
324  ]
325  );
326  $this->assertAssertionDataSet('copyPageWHotelBeforeParentContent');
327 
328  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0)->getResponseSections();
329  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
330  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
331  }
332 
342  {
343  parent::createParentContentWithHotelAndOfferChildren();
344  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
345  $this->assertAssertionDataSet('createParentContentNHotelNOfferChildren');
346 
347  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
348  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
349  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
350  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
351  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
352  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
353  }
354 
360  {
361  parent::createAndCopyParentContentWithHotelAndOfferChildren();
362  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
363  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId']);
364  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildren');
365 
366  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
367  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
368  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
369  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
370  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
371  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
372  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
373  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentHotel)
374  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
375  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
376  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['copiedHotelId'])->setRecordField(self::FIELD_HotelOffer)
377  ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1'));
378  }
379 
385  {
386  parent::createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent();
387  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
388  // Actually this is not required, since there's nothing to publish... but it's a test case!
389  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId'], false);
390  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildrenNDiscardCopiedParent');
391 
392  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
393  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
394  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
395  }
396 
402  {
403  parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
404  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
405  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
406  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
407 
408  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
409  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
410  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
411  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
412  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
413  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
414  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
415  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['localizedHotelId'])->setRecordField(self::FIELD_HotelOffer)
416  ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
417  }
418 
424  {
425  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent();
426  // Actually this is not required, since there's nothing to publish... but it's a test case!
427  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId'], false);
428  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardCreatedParent');
429 
430  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
431  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
432  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', '[Translate to Dansk:] Testing #1'));
433  }
434 
440  {
441  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent();
442  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
443  // Actually this is not required, since there's nothing to publish... but it's a test case!
444  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId'], false);
445  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardLocalizedParent');
446 
447  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
448  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
449  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
450  }
451 
456  public function modifyOnlyHotelChild()
457  {
458  parent::modifyOnlyHotelChild();
459  $this->actionService->publishRecord(self::TABLE_Hotel, 4);
460  $this->assertAssertionDataSet('modifyOnlyHotelChild');
461 
462  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
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::modifyParentAndChangeHotelChildrenSorting();
475  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
476  $this->assertAssertionDataSet('modifyParentNChangeHotelChildrenSorting');
477 
478  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
479  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
480  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
481  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2', 'Hotel #1'));
482  }
483 
488  public function modifyParentWithHotelChild()
489  {
490  parent::modifyParentWithHotelChild();
491  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
492  $this->assertAssertionDataSet('modifyParentNHotelChild');
493 
494  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
495  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
496  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
497  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
498  }
499 
505  {
506  parent::modifyParentWithHotelChildAndDiscardModifiedParent();
507  // Actually this is not required, since there's nothing to publish... but it's a test case!
508  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, false);
509  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardModifiedParent');
510 
511  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
512  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
513  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
514  // Discarding the parent shall not discard the child records
515  // Since the discarded parent does not need to be published, version children are not published as well
516  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
517  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
518  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
519  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
520  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
521  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #1'));
522  }
523 
529  {
530  parent::modifyParentWithHotelChildAndDiscardAll();
531  // Actually this is not required, since there's nothing to publish... but it's a test case!
532  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, false);
533  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardAll');
534 
535  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
536  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
537  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
538  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
539  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
540  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
541  }
542 
548  {
549  parent::modifyParentAndAddHotelChild();
550  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
551  $this->assertAssertionDataSet('modifyParentNAddHotelChild');
552 
553  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
554  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
555  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
556  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
557  }
558 
564  {
565  parent::modifyParentAndDeleteHotelChild();
566  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
567  $this->assertAssertionDataSet('modifyParentNDeleteHotelChild');
568 
569  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
570  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
571  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
572  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
573  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
574  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
575  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
576  }
577 
583  {
584  parent::modifyAndDiscardAndModifyParentWithHotelChild();
585  $this->actionService->publishRecords(
586  [
587  self::TABLE_Content => [self::VALUE_ContentIdFirst],
588  self::TABLE_Hotel => [3, 4],
589  ]
590  );
591  $this->assertAssertionDataSet('modifyNDiscardNModifyParentWHotelChild');
592 
593  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
594  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
595  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
596  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
597  ->setTable(self::TABLE_Hotel)->setField('header')->setValues('Testing #1'));
598  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
599  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #2'));
600  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
601  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #2'));
602  }
603 }
getFrontendResponse($pageId, $languageId=0, $backendUserId=0, $workspaceId=0, $failOnFailure=true, $frontendUserId=0)