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/CSV/Publish/DataSet/';
28 
33  public function setUp() {
34  parent::setUp();
35  }
36 
41  public function createParentContent() {
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  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  parent::deleteParentContent();
74  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
75  $this->assertAssertionDataSet('deleteParentContent');
76 
77  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
78  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
79  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
80  }
81 
87  parent::deleteParentContentAndDiscardDeletedParent();
88  // Actually this is not required, since there's nothing to publish... but it's a test case!
89  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast, FALSE);
90  $this->assertAssertionDataSet('deleteParentContentNDiscardDeletedParent');
91 
92  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
93  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
94  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
95  }
96 
101  public function copyParentContent() {
102  parent::copyParentContent();
103  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
104  $this->assertAssertionDataSet('copyParentContent');
105 
106  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
107  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
108  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
109  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
110  }
111 
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();
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  parent::localizeParentContentInKeepMode();
133  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
134  $this->assertAssertionDataSet('localizeParentContentKeep');
135 
136  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
137  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
138  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
139  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
140  }
141 
147  parent::localizeParentContentWithAllChildrenInKeepMode();
148  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
149  $this->assertAssertionDataSet('localizeParentContentWAllChildrenKeep');
150 
151  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
152  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
153  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
154  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
155  }
156 
162  parent::localizeParentContentInSelectMode();
163  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
164  $this->assertAssertionDataSet('localizeParentContentSelect');
165 
166  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
167  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
168  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
169  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
170  }
171 
177  parent::localizeParentContentWithAllChildrenInSelectMode();
178  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
179  $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelect');
180 
181  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
182  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
183  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
184  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
185  }
186 
191  public function changeParentContentSorting() {
192  parent::changeParentContentSorting();
193  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
194  $this->assertAssertionDataSet('changeParentContentSorting');
195 
196  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
197  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
198  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
199  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
200  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
201  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
202  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
203  }
204 
210  parent::moveParentContentToDifferentPage();
211  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
212  $this->assertAssertionDataSet('moveParentContentToDifferentPage');
213 
214  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections();
215  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
216  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
217  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
218  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
219  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
220  }
221 
227  parent::moveParentContentToDifferentPageAndChangeSorting();
228  $this->actionService->publishRecords(
229  array(
230  self::TABLE_Content => array(self::VALUE_ContentIdFirst, self::VALUE_ContentIdLast),
231  )
232  );
233  $this->assertAssertionDataSet('moveParentContentToDifferentPageNChangeSorting');
234 
235  $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections();
236  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
237  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2', 'Regular Element #1'));
238  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
239  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
240  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
241  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
242  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
243  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
244  }
245 
254  public function modifyPage() {
255  parent::modifyPage();
256  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
257  $this->assertAssertionDataSet('modifyPage');
258 
259  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
260  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
261  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
262  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
263  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
264  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
265  }
266 
271  public function deletePage() {
272  parent::deletePage();
273  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
274  $this->assertAssertionDataSet('deletePage');
275 
276  $response = $this->getFrontendResponse(self::VALUE_PageId, 0, 0, 0, FALSE);
277  $this->assertContains('PageNotFoundException', $response->getError());
278  }
279 
284  public function copyPage() {
285  parent::copyPage();
286  $this->actionService->publishRecords(
287  array(
288  self::TABLE_Page => array($this->recordIds['newPageId']),
289  self::TABLE_Content => array($this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']),
290  )
291  );
292  $this->assertAssertionDataSet('copyPage');
293 
294  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0)->getResponseSections();
295  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
296  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
297  }
298 
304  parent::copyPageWithHotelBeforeParentContent();
305  $this->actionService->publishRecords(
306  array(
307  self::TABLE_Page => array($this->recordIds['newPageId']),
308  self::TABLE_Content => array($this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']),
309  )
310  );
311  $this->assertAssertionDataSet('copyPageWHotelBeforeParentContent');
312 
313  $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0)->getResponseSections();
314  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
315  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
316  }
317 
327  parent::createParentContentWithHotelAndOfferChildren();
328  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
329  $this->assertAssertionDataSet('createParentContentNHotelNOfferChildren');
330 
331  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
332  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
333  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
334  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
335  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
336  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
337  }
338 
344  parent::createAndCopyParentContentWithHotelAndOfferChildren();
345  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
346  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId']);
347  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildren');
348 
349  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
350  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
351  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
352  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
353  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
354  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
355  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
356  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentHotel)
357  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
358  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
359  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['copiedHotelId'])->setRecordField(self::FIELD_HotelOffer)
360  ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1'));
361  }
362 
368  parent::createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent();
369  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
370  // Actually this is not required, since there's nothing to publish... but it's a test case!
371  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId'], FALSE);
372  $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildrenNDiscardCopiedParent');
373 
374  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
375  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
376  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
377  }
378 
384  parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
385  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
386  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
387  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren');
388 
389  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
390  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
391  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
392  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
393  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
394  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
395  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
396  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['localizedHotelId'])->setRecordField(self::FIELD_HotelOffer)
397  ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
398  }
399 
405  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent();
406  // Actually this is not required, since there's nothing to publish... but it's a test case!
407  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId'], FALSE);
408  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardCreatedParent');
409 
410  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
411  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
412  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', '[Translate to Dansk:] Testing #1'));
413  }
414 
420  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent();
421  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
422  // Actually this is not required, since there's nothing to publish... but it's a test case!
423  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId'], FALSE);
424  $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardLocalizedParent');
425 
426  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
427  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
428  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
429  }
430 
435  public function modifyOnlyHotelChild() {
436  parent::modifyOnlyHotelChild();
437  $this->actionService->publishRecord(self::TABLE_Hotel, 4);
438  $this->assertAssertionDataSet('modifyOnlyHotelChild');
439 
440  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
441  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
442  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
443  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
444  }
445 
451  parent::modifyParentAndChangeHotelChildrenSorting();
452  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
453  $this->assertAssertionDataSet('modifyParentNChangeHotelChildrenSorting');
454 
455  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
456  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
457  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
458  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2', 'Hotel #1'));
459  }
460 
465  public function modifyParentWithHotelChild() {
466  parent::modifyParentWithHotelChild();
467  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
468  $this->assertAssertionDataSet('modifyParentNHotelChild');
469 
470  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
471  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
472  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
473  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
474  }
475 
481  parent::modifyParentWithHotelChildAndDiscardModifiedParent();
482  // Actually this is not required, since there's nothing to publish... but it's a test case!
483  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, FALSE);
484  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardModifiedParent');
485 
486  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
487  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
488  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
489  // Discarding the parent shall not discard the child records
490  // Since the discarded parent does not need to be published, version children are not published as well
491  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
492  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
493  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
494  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
495  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
496  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #1'));
497  }
498 
504  parent::modifyParentWithHotelChildAndDiscardAll();
505  // Actually this is not required, since there's nothing to publish... but it's a test case!
506  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, FALSE);
507  $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardAll');
508 
509  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
510  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
511  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
512  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
513  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
514  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
515  }
516 
521  public function modifyParentAndAddHotelChild() {
522  parent::modifyParentAndAddHotelChild();
523  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
524  $this->assertAssertionDataSet('modifyParentNAddHotelChild');
525 
526  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
527  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
528  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
529  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
530  }
531 
537  parent::modifyParentAndDeleteHotelChild();
538  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
539  $this->assertAssertionDataSet('modifyParentNDeleteHotelChild');
540 
541  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
542  $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
543  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
544  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
545  $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
546  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
547  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
548  }
549 
555  parent::modifyAndDiscardAndModifyParentWithHotelChild();
556  $this->actionService->publishRecords(
557  array(
558  self::TABLE_Content => array(self::VALUE_ContentIdFirst),
559  self::TABLE_Hotel => array(3, 4),
560  )
561  );
562  $this->assertAssertionDataSet('modifyNDiscardNModifyParentWHotelChild');
563 
564  $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
565  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
566  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
567  $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
568  ->setTable(self::TABLE_Hotel)->setField('header')->setValues('Testing #1'));
569  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
570  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #2'));
571  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
572  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #2'));
573  }
574 
575 }
getFrontendResponse($pageId, $languageId=0, $backendUserId=0, $workspaceId=0, $failOnFailure=TRUE)