[TASK] Remove blank line between docblock and the documented element
[Packages/TYPO3.CMS.git] / typo3 / sysext / workspaces / Tests / Functional / DataHandling / IRRE / CSV / PublishAll / ActionTest.php
1 <?php
2 namespace TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\PublishAll;
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
17 /**
18 * Functional test for the DataHandler
19 */
20 class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase
21 {
22 /**
23 * @var string
24 */
25 protected $assertionDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/PublishAll/DataSet/';
26
27 /**
28 * Parent content records
29 */
30 protected function setUp()
31 {
32 parent::setUp();
33 }
34
35 /**
36 * @test
37 * @see DataSet/Assertion/createParentContentRecord.csv
38 */
39 public function createParentContent()
40 {
41 parent::createParentContent();
42 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
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
50 /**
51 * @test
52 * @see DataSet/Assertion/modifyParentContentRecord.csv
53 */
54 public function modifyParentContent()
55 {
56 parent::modifyParentContent();
57 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
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
68 /**
69 * @test
70 * @see DataSet/Assertion/deleteParentContentRecord.csv
71 */
72 public function deleteParentContent()
73 {
74 parent::deleteParentContent();
75 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
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
83 /**
84 * @test
85 * @see DataSet/Assertion/deleteParentContentRecordAndDiscardDeletedParentRecord.csv
86 */
87 public function deleteParentContentAndDiscardDeletedParent()
88 {
89 parent::deleteParentContentAndDiscardDeletedParent();
90 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
91 $this->assertAssertionDataSet('deleteParentContentNDiscardDeletedParent');
92
93 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
94 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
95 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
96 }
97
98 /**
99 * @test
100 * @see DataSet/Assertion/copyParentContentRecord.csv
101 */
102 public function copyParentContent()
103 {
104 parent::copyParentContent();
105 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
106 $this->assertAssertionDataSet('copyParentContent');
107
108 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
109 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
110 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
111 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
112 }
113
114 /**
115 * @test
116 * @see DataSet/copyParentContentToDifferentPage.csv
117 */
118 public function copyParentContentToDifferentPage()
119 {
120 parent::copyParentContentToDifferentPage();
121 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
122 $this->assertAssertionDataSet('copyParentContentToDifferentPage');
123
124 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections();
125 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
126 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
127 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
128 }
129
130 /**
131 * @test
132 * @see DataSet/localizeParentContentKeep.csv
133 */
134 public function localizeParentContentInKeepMode()
135 {
136 parent::localizeParentContentInKeepMode();
137 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
138 $this->assertAssertionDataSet('localizeParentContentKeep');
139
140 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
141 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
142 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
143 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
144 }
145
146 /**
147 * @test
148 * @see DataSet/localizeParentContentWAllChildrenKeep.csv
149 */
150 public function localizeParentContentWithAllChildrenInKeepMode()
151 {
152 parent::localizeParentContentWithAllChildrenInKeepMode();
153 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
154 $this->assertAssertionDataSet('localizeParentContentWAllChildrenKeep');
155
156 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
157 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
158 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
159 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
160 }
161
162 /**
163 * @test
164 * @see DataSet/localizeParentContentSelect.csv
165 */
166 public function localizeParentContentInSelectMode()
167 {
168 parent::localizeParentContentInSelectMode();
169 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
170 $this->assertAssertionDataSet('localizeParentContentSelect');
171
172 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
173 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
174 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
175 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
176 }
177
178 /**
179 * @test
180 * @see DataSet/localizeParentContentWAllChildrenSelect.csv
181 */
182 public function localizeParentContentWithAllChildrenInSelectMode()
183 {
184 parent::localizeParentContentWithAllChildrenInSelectMode();
185 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
186 $this->assertAssertionDataSet('localizeParentContentWAllChildrenSelect');
187
188 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
189 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
190 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
191 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
192 }
193
194 /**
195 * @test
196 * @see DataSet/Assertion/changeParentContentRecordSorting.csv
197 */
198 public function changeParentContentSorting()
199 {
200 parent::changeParentContentSorting();
201 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
202 $this->assertAssertionDataSet('changeParentContentSorting');
203
204 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
205 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
206 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
207 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
208 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
209 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
210 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
211 }
212
213 /**
214 * @test
215 * @see DataSet/Assertion/moveParentContentRecordToDifferentPage.csv
216 */
217 public function moveParentContentToDifferentPage()
218 {
219 parent::moveParentContentToDifferentPage();
220 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
221 $this->assertAssertionDataSet('moveParentContentToDifferentPage');
222
223 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections();
224 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
225 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
226 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
227 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
228 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
229 }
230
231 /**
232 * @test
233 * @see DataSet/Assertion/moveParentContentRecordToDifferentPageAndChangeSorting.csv
234 */
235 public function moveParentContentToDifferentPageAndChangeSorting()
236 {
237 parent::moveParentContentToDifferentPageAndChangeSorting();
238 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
239 $this->assertAssertionDataSet('moveParentContentToDifferentPageNChangeSorting');
240
241 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0)->getResponseSections();
242 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
243 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2', 'Regular Element #1'));
244 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
245 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
246 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
247 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
248 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
249 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
250 }
251
252 /**
253 * Page records
254 */
255
256 /**
257 * @test
258 * @see DataSet/Assertion/modifyPageRecord.csv
259 */
260 public function modifyPage()
261 {
262 parent::modifyPage();
263 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
264 $this->assertAssertionDataSet('modifyPage');
265
266 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
267 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
268 ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
269 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
270 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
271 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
272 }
273
274 /**
275 * @test
276 * @see DataSet/Assertion/deletePageRecord.csv
277 */
278 public function deletePage()
279 {
280 parent::deletePage();
281 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
282 $this->assertAssertionDataSet('deletePage');
283
284 $response = $this->getFrontendResponse(self::VALUE_PageId, 0, 0, 0, false);
285 $this->assertContains('PageNotFoundException', $response->getError());
286 }
287
288 /**
289 * @test
290 * @see DataSet/Assertion/copyPageRecord.csv
291 */
292 public function copyPage()
293 {
294 parent::copyPage();
295 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
296 $this->assertAssertionDataSet('copyPage');
297
298 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0)->getResponseSections();
299 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
300 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
301 }
302
303 /**
304 * @test
305 * @see DataSet/Assertion/copyPageWHotelBeforeParentContent.csv
306 */
307 public function copyPageWithHotelBeforeParentContent()
308 {
309 parent::copyPageWithHotelBeforeParentContent();
310 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
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
318 /**
319 * IRRE Child Records
320 */
321
322 /**
323 * @test
324 * @see DataSet/Assertion/createParentContentRecordWithHotelAndOfferChildRecords.csv
325 */
326 public function createParentContentWithHotelAndOfferChildren()
327 {
328 parent::createParentContentWithHotelAndOfferChildren();
329 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
330 $this->assertAssertionDataSet('createParentContentNHotelNOfferChildren');
331
332 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
333 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
334 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
335 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
336 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
337 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
338 }
339
340 /**
341 * @test
342 * @see DataSet/Assertion/createAndCopyParentContentRecordWithHotelAndOfferChildRecords.csv
343 */
344 public function createAndCopyParentContentWithHotelAndOfferChildren()
345 {
346 parent::createAndCopyParentContentWithHotelAndOfferChildren();
347 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
348 $this->assertAssertionDataSet('createNCopyParentContentNHotelNOfferChildren');
349
350 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
351 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
352 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
353 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
354 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
355 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
356 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
357 ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentHotel)
358 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
359 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
360 ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['copiedHotelId'])->setRecordField(self::FIELD_HotelOffer)
361 ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1'));
362 }
363
364 /**
365 * @test
366 * @see DataSet/Assertion/createAndCopyParentContentRecordWithHotelAndOfferChildRecordsAndDiscardCopiedParentRecord.csv
367 */
368 public function createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent()
369 {
370 parent::createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent();
371 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
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
379 /**
380 * @test
381 * @see DataSet/Assertion/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecords.csv
382 */
383 public function createAndLocalizeParentContentWithHotelAndOfferChildren()
384 {
385 parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
386 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
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
400 /**
401 * @test
402 * @see DataSet/Assertion/createNLocalizeParentContentNHotelNOfferChildrenNDiscardCreatedParent.csv
403 */
404 public function createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent()
405 {
406 parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent();
407 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
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
415 /**
416 * @test
417 * @see DataSet/Assertion/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecordsAndDiscardLocalizedParentRecord.csv
418 */
419 public function createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent()
420 {
421 parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent();
422 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
423 $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenNDiscardLocalizedParent');
424
425 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
426 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
427 ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
428 }
429
430 /**
431 * @test
432 * @see DataSet/Assertion/modifyOnlyHotelChildRecord.csv
433 */
434 public function modifyOnlyHotelChild()
435 {
436 parent::modifyOnlyHotelChild();
437 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
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
446 /**
447 * @test
448 * @see DataSet/Assertion/modifyParentRecordAndChangeHotelChildRecordsSorting.csv
449 */
450 public function modifyParentAndChangeHotelChildrenSorting()
451 {
452 parent::modifyParentAndChangeHotelChildrenSorting();
453 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
454 $this->assertAssertionDataSet('modifyParentNChangeHotelChildrenSorting');
455
456 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
457 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
458 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
459 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2', 'Hotel #1'));
460 }
461
462 /**
463 * @test
464 * @see DataSet/Assertion/modifyParentRecordWithHotelChildRecord.csv
465 */
466 public function modifyParentWithHotelChild()
467 {
468 parent::modifyParentWithHotelChild();
469 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
470 $this->assertAssertionDataSet('modifyParentNHotelChild');
471
472 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
473 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
474 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
475 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
476 }
477
478 /**
479 * @test
480 * @see DataSet/Assertion/modifyParentRecordWithHotelChildRecordAndDiscardModifiedParentRecord.csv
481 */
482 public function modifyParentWithHotelChildAndDiscardModifiedParent()
483 {
484 parent::modifyParentWithHotelChildAndDiscardModifiedParent();
485 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
486 $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardModifiedParent');
487
488 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
489 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
490 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
491 // Discarding the parent shall not discard the child records
492 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
493 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
494 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
495 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
496 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
497 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
498 }
499
500 /**
501 * @test
502 * @see DataSet/Assertion/modifyParentRecordWithHotelChildRecordAndDiscardAllModifiedRecords.csv
503 */
504 public function modifyParentWithHotelChildAndDiscardAll()
505 {
506 parent::modifyParentWithHotelChildAndDiscardAll();
507 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
508 $this->assertAssertionDataSet('modifyParentNHotelChildNDiscardAll');
509
510 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
511 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
512 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
513 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
514 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
515 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
516 }
517
518 /**
519 * @test
520 * @see DataSet/Assertion/modifyParentRecordAndAddHotelChildRecord.csv
521 */
522 public function modifyParentAndAddHotelChild()
523 {
524 parent::modifyParentAndAddHotelChild();
525 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
526 $this->assertAssertionDataSet('modifyParentNAddHotelChild');
527
528 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
529 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
530 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
531 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
532 }
533
534 /**
535 * @test
536 * @see DataSet/Assertion/modifyParentRecordAndDeleteHotelChildRecord.csv
537 */
538 public function modifyParentAndDeleteHotelChild()
539 {
540 parent::modifyParentAndDeleteHotelChild();
541 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
542 $this->assertAssertionDataSet('modifyParentNDeleteHotelChild');
543
544 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0)->getResponseSections();
545 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
546 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
547 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
548 $this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
549 ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
550 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
551 }
552
553 /**
554 * @test
555 * @see DataSet/modifyNDiscardNModifyParentWHotelChild.csv
556 */
557 public function modifyAndDiscardAndModifyParentWithHotelChild()
558 {
559 parent::modifyAndDiscardAndModifyParentWithHotelChild();
560 $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
561 $this->assertAssertionDataSet('modifyNDiscardNModifyParentWHotelChild');
562
563 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
564 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
565 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
566 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
567 ->setTable(self::TABLE_Hotel)->setField('header')->setValues('Testing #1'));
568 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
569 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #2'));
570 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
571 ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Testing #2'));
572 }
573 }