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