TYPO3 CMS  TYPO3_6-2
ActionTest.php
Go to the documentation of this file.
1 <?php
3 
17 require_once dirname(dirname(__FILE__)) . '/AbstractActionTestCase.php';
18 
23 
27  protected $assertionDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Publish/DataSet/';
28 
37  public function createParentContent() {
38  parent::createParentContent();
39  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
40  $this->assertAssertionDataSet('createParentContent');
41 
42  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
43  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
44  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
45  }
46 
51  public function modifyParentContent() {
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  parent::deleteParentContent();
70  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
71  $this->assertAssertionDataSet('deleteParentContent');
72 
73  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
74  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
75  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
76  }
77 
83  parent::deleteParentContentAndDiscardDeletedParent();
84  // Actually this is not required, since there's nothing to publish... but it's a test case!
85  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast, FALSE);
86  $this->assertAssertionDataSet('deleteParentContentNDiscardDeletedParent');
87 
88  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
89  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
90  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
91  }
92 
97  public function copyParentContent() {
98  parent::copyParentContent();
99  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
100  $this->assertAssertionDataSet('copyParentContent');
101 
102  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
103  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
104  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
105  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
106  }
107 
113  parent::copyParentContentToDifferentPage();
114  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
115  $this->assertAssertionDataSet('copyParentContentToDifferentPage');
116 
117  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections('Default', 'Extbase:list()');
118  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
119  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
120  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
121  }
122 
128  parent::localizeParentContentInKeepMode();
129  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
130  $this->assertAssertionDataSet('localizeParentContentKeep');
131 
132  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
133  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
134  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
135  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
136  }
137 
143  parent::localizeParentContentWithAllChildrenInKeepMode();
144  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
145  $this->assertAssertionDataSet('localizeParentContentWAllChildrenKeep');
146 
147  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
148  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
149  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
150  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
151  }
152 
158  parent::localizeParentContentInSelectMode();
159  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
160  $this->assertAssertionDataSet('localizeParentContentSelect');
161 
162  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
163  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
164  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
165  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
166  }
167 
173  parent::localizeParentContentWithAllChildrenInSelectMode();
174  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
175  $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelect');
176 
177  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
178  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
179  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
180  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
181  }
182 
187  public function changeParentContentSorting() {
188  parent::changeParentContentSorting();
189  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
190  $this->assertAssertionDataSet('changeParentContentSorting');
191 
192  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
193  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
194  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
195  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
196  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
197  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
198  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
199  }
200 
206  parent::moveParentContentToDifferentPage();
207  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
208  $this->assertAssertionDataSet('moveParentContentToDifferentPage');
209 
210  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections('Default', 'Extbase:list()');
211  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
212  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
213 
214  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
215  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
216  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
217  }
218 
224  parent::moveParentContentToDifferentPageAndChangeSorting();
225  $this->actionService->publishRecords(
226  array(
227  self::TABLE_Content => array(self::VALUE_ContentIdFirst, self::VALUE_ContentIdLast),
228  )
229  );
230  $this->assertAssertionDataSet('moveParentContentToDifferentPageNChangeSorting');
231 
232  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections('Default', 'Extbase:list()');
233  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
234  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2', 'Regular Element #1'));
235  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
236  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
237  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
238  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
239  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
240  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
241  }
242 
251  public function modifyPage() {
252  parent::modifyPage();
253  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
254  $this->assertAssertionDataSet('modifyPage');
255 
256  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
257  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
258  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
259  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
260  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
261  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
262  }
263 
268  public function deletePage() {
269  parent::deletePage();
270  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
271  $this->assertAssertionDataSet('deletePage');
272 
273  $response = $this->getFrontendResponse(self::VALUE_PageId, 0, 0, 0, FALSE);
274  $this->assertContains('PageNotFoundException', $response->getError());
275  }
276 
281  public function copyPage() {
282  parent::copyPage();
283  $this->actionService->publishRecords(
284  array(
285  self::TABLE_Page => array($this->recordIds['newPageId']),
286  self::TABLE_Content => array($this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']),
287  )
288  );
289  $this->assertAssertionDataSet('copyPage');
290 
291  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0)->getResponseSections('Default', 'Extbase:list()');
292  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
293  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
294  }
295 
301  parent::copyPageWithHotelBeforeParentContent();
302  $this->actionService->publishRecords(
303  array(
304  self::TABLE_Page => array($this->recordIds['newPageId']),
305  self::TABLE_Content => array($this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']),
306  )
307  );
308  $this->assertAssertionDataSet('copyPageWHotelBeforeParentContent');
309 
310  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0)->getResponseSections('Default', 'Extbase:list()');
311  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
312  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
313  }
314 
324  parent::createParentContentWithHotelAndOfferChildren();
325  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
326  $this->assertAssertionDataSet('createParentContentNHotelNOfferChildren');
327 
328  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
329  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
330  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
331  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
332  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
333  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
334  }
335 
341  parent::createAndCopyParentContentWithHotelAndOfferChildren();
342  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
343  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId']);
344  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildren');
345 
346  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
347  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
348  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
349  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
350  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
351  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
352  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
353  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentHotel)
354  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
355  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
356  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['copiedHotelId'])->setRecordField(self::FIELD_HotelOffer)
357  ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1'));
358  }
359 
365  parent::createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent();
366  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
367  // Actually this is not required, since there's nothing to publish... but it's a test case!
368  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId'], FALSE);
369  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildrenNDiscardCopiedParent');
370 
371  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
372  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
373  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
374  }
375 
381  parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
382  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
383  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
384  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
385 
386  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
387  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
388  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
389  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
390  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
391  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
392  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
393  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
394  ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
395  }
396 
402  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent();
403  // Actually this is not required, since there's nothing to publish... but it's a test case!
404  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId'], FALSE);
405  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardCreatedParent');
406 
407  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
408  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
409  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', '[Translate to Dansk:] Testing #1'));
410  }
411 
417  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent();
418  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
419  // Actually this is not required, since there's nothing to publish... but it's a test case!
420  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId'], FALSE);
421  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardLocalizedParent');
422 
423  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
424  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
425  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
426  }
427 
432  public function modifyOnlyHotelChild() {
433  parent::modifyOnlyHotelChild();
434  $this->actionService->publishRecord(self::TABLE_Hotel, 4);
435  $this->assertAssertionDataSet('modifyOnlyHotelChild');
436 
437  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
438  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
439  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
440  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
441  }
442 
448  parent::modifyParentAndChangeHotelChildrenSorting();
449  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
450  $this->assertAssertionDataSet('modifyParentNChangeHotelChildrenSorting');
451 
452  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
453  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
454  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
455  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2', 'Hotel #1'));
456  }
457 
462  public function modifyParentWithHotelChild() {
463  parent::modifyParentWithHotelChild();
464  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
465  $this->assertAssertionDataSet('modifyParentNHotelChild');
466 
467  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
468  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
469  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
470  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
471  }
472 
478  parent::modifyParentWithHotelChildAndDiscardModifiedParent();
479  // Actually this is not required, since there's nothing to publish... but it's a test case!
480  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, FALSE);
481  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardModifiedParent');
482 
483  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
484  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
485  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
486  // Discarding the parent shall not discard the child records
487  // Since the discarded parent does not need to be published, version children are not published as well
488  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
489  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
490  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
491  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
492  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
493  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #1'));
494  }
495 
501  parent::modifyParentWithHotelChildAndDiscardAll();
502  // Actually this is not required, since there's nothing to publish... but it's a test case!
503  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, FALSE);
504  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardAll');
505 
506  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
507  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
508  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
509  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
510  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
511  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
512  }
513 
518  public function modifyParentAndAddHotelChild() {
519  parent::modifyParentAndAddHotelChild();
520  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
521  $this->assertAssertionDataSet('modifyParentNAddHotelChild');
522 
523  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
524  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
525  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
526  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
527  }
528 
534  parent::modifyParentAndDeleteHotelChild();
535  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
536  $this->assertAssertionDataSet('modifyParentNDeleteHotelChild');
537 
538  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections('Default', 'Extbase:list()');
539  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
540  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
541  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
542  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
543  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
544  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
545  }
546 
552  parent::modifyAndDiscardAndModifyParentWithHotelChild();
553  $this->actionService->publishRecords(
554  array(
555  self::TABLE_Content => array(self::VALUE_ContentIdFirst),
556  self::TABLE_Hotel => array(3, 4),
557  )
558  );
559  $this->assertAssertionDataSet('modifyNDiscardNModifyParentWHotelChild');
560 
561  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
562  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
563  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
564  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
565  ->setTable(self::TABLE_Hotel)->setField('header')->setValues('Testing #1'));
566  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
567  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #2'));
568  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
569  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #2'));
570  }
571 
572 }
getFrontendResponse($pageId, $languageId=0, $backendUserId=0, $workspaceId=0, $failOnFailure=TRUE)