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