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