[TASK] Streamline workspace DataHandler functional tests
[Packages/TYPO3.CMS.git] / typo3 / sysext / workspaces / Tests / Functional / DataHandling / Regular / Modify / ActionTest.php
1 <?php
2 namespace TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify;
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\Regular\AbstractActionTestCase
21 {
22 /**
23 * @var string
24 */
25 protected $assertionDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/DataSet/';
26
27 /**
28 * Content records
29 */
30
31 /**
32 * @test
33 * @see DataSet/createContentRecords.csv
34 */
35 public function createContents()
36 {
37 parent::createContents();
38 $this->assertAssertionDataSet('createContents');
39
40 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
41 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
42 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', 'Testing #2'));
43 }
44
45 /**
46 * @test
47 * @see DataSet/createContentRecordAndDiscardCreatedContentRecord.csv
48 */
49 public function createContentAndDiscardCreatedContent()
50 {
51 parent::createContentAndDiscardCreatedContent();
52 $this->assertAssertionDataSet('createContentNDiscardCreatedContent');
53
54 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
55 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
56 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
57 }
58
59 /**
60 * @test
61 * @see DataSet/createAndCopyContentRecordAndDiscardCopiedContentRecord.csv
62 */
63 public function createAndCopyContentAndDiscardCopiedContent()
64 {
65 parent::createAndCopyContentAndDiscardCopiedContent();
66 $this->assertAssertionDataSet('createNCopyContentNDiscardCopiedContent');
67
68 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
69 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
70 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
71 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
72 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1 (copy 1)'));
73 }
74
75 /**
76 * @test
77 * @see DataSet/modifyContentRecord.csv
78 */
79 public function modifyContent()
80 {
81 parent::modifyContent();
82 $this->assertAssertionDataSet('modifyContent');
83
84 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
85 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
86 ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
87 }
88
89 /**
90 * @test
91 * @see DataSet/deleteContentRecord.csv
92 */
93 public function deleteContent()
94 {
95 parent::deleteContent();
96 $this->assertAssertionDataSet('deleteContent');
97
98 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
99 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
100 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
101 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
102 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
103 }
104
105 /**
106 * @test
107 * @see DataSet/deleteLocalizedContentNDeleteContent.csv
108 */
109 public function deleteLocalizedContentAndDeleteContent()
110 {
111 parent::deleteLocalizedContentAndDeleteContent();
112 $this->assertAssertionDataSet('deleteLocalizedContentNDeleteContent');
113
114 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
115 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
116 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #3', '[Translate to Dansk:] Regular Element #3'));
117 }
118
119 /**
120 * @test
121 * @see DataSet/copyContentRecord.csv
122 */
123 public function copyContent()
124 {
125 parent::copyContent();
126 $this->assertAssertionDataSet('copyContent');
127
128 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
129 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
130 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2 (copy 1)'));
131 }
132
133 /**
134 * @test
135 * @see DataSet/copyContentToLanguage.csv
136 */
137 public function copyContentToLanguage()
138 {
139 parent::copyContentToLanguage();
140 $this->assertAssertionDataSet('copyContentToLanguage');
141
142 $this->setUpFrontendRootPage(1, [
143 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
144 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.ts'
145 ]);
146 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
147 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
148 ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2'));
149 }
150
151 /**
152 * @test
153 * @see DataSet/copyContentToLanguageFromNonDefaultLanguage.csv
154 */
155 public function copyContentToLanguageFromNonDefaultLanguage()
156 {
157 parent::copyContentToLanguageFromNonDefaultLanguage();
158 $this->assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage');
159
160 $this->setUpFrontendRootPage(1, [
161 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
162 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.ts'
163 ]);
164 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
165 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
166 ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
167 }
168
169 /**
170 * @test
171 * @see DataSet/localizeContentRecord.csv
172 */
173 public function localizeContent()
174 {
175 parent::localizeContent();
176 $this->assertAssertionDataSet('localizeContent');
177
178 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
179 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
180 ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
181 }
182
183 /**
184 * @test
185 * @see DataSet/localizeContentFromNonDefaultLanguage.csv
186 */
187 public function localizeContentFromNonDefaultLanguage()
188 {
189 parent::localizeContentFromNonDefaultLanguage();
190
191 $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
192
193 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
194 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
195 ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1', '[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
196 }
197
198 /**
199 * @test
200 * @see DataSet/changeContentRecordSorting.csv
201 */
202 public function changeContentSorting()
203 {
204 parent::changeContentSorting();
205 $this->assertAssertionDataSet('changeContentSorting');
206
207 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
208 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
209 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
210 }
211
212 /**
213 * @test
214 * @see DataSet/changeContentSortingNDeleteMovedRecord.csv
215 */
216 public function changeContentSortingAndDeleteMovedRecord()
217 {
218 parent::changeContentSortingAndDeleteMovedRecord();
219 $this->assertAssertionDataSet('changeContentSortingNDeleteMovedRecord');
220
221 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
222 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
223 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
224 }
225
226 /**
227 * @test
228 * @see DataSet/changeContentSortingNDeleteLiveRecord.csv
229 */
230 public function changeContentSortingAndDeleteLiveRecord()
231 {
232 parent::changeContentSortingAndDeleteLiveRecord();
233 $this->assertAssertionDataSet('changeContentSortingNDeleteLiveRecord');
234
235 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
236 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
237 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
238 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
239 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
240 }
241
242 /**
243 * @test
244 * @see DataSet/moveContentRecordToDifferentPage.csv
245 */
246 public function moveContentToDifferentPage()
247 {
248 parent::moveContentToDifferentPage();
249 $this->assertAssertionDataSet('moveContentToDifferentPage');
250
251 $responseSectionsSource = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
252 $this->assertThat($responseSectionsSource, $this->getRequestSectionHasRecordConstraint()
253 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
254 $responseSectionsTarget = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
255 $this->assertThat($responseSectionsTarget, $this->getRequestSectionHasRecordConstraint()
256 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
257 }
258
259 /**
260 * @test
261 * @see DataSet/moveContentRecordToDifferentPageAndChangeSorting.csv
262 */
263 public function moveContentToDifferentPageAndChangeSorting()
264 {
265 parent::moveContentToDifferentPageAndChangeSorting();
266 $this->assertAssertionDataSet('moveContentToDifferentPageNChangeSorting');
267
268 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
269 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
270 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
271 }
272
273 /**
274 * Page records
275 */
276
277 /**
278 * @test
279 * @see DataSet/createPageRecord.csv
280 */
281 public function createPage()
282 {
283 parent::createPage();
284 $this->assertAssertionDataSet('createPage');
285
286 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
287 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
288 ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
289 }
290
291 /**
292 * @test
293 * @see DataSet/modifyPageRecord.csv
294 */
295 public function modifyPage()
296 {
297 parent::modifyPage();
298 $this->assertAssertionDataSet('modifyPage');
299
300 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
301 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
302 ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
303 }
304
305 /**
306 * @test
307 * @see DataSet/deletePageRecord.csv
308 */
309 public function deletePage()
310 {
311 parent::deletePage();
312 $this->assertAssertionDataSet('deletePage');
313
314 $response = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId, false);
315 $this->assertContains('RuntimeException', $response->getError());
316 }
317
318 /**
319 * @test
320 * @see DataSet/deleteContentAndPage.csv
321 */
322 public function deleteContentAndPage()
323 {
324 parent::deleteContentAndPage();
325 $this->assertAssertionDataSet('deleteContentAndPage');
326
327 $response = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId, false);
328 $this->assertContains('RuntimeException', $response->getError());
329 }
330
331 /**
332 * @test
333 * @see DataSet/copyPageRecord.csv
334 */
335 public function copyPage()
336 {
337 parent::copyPage();
338 $this->assertAssertionDataSet('copyPage');
339
340 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
341 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
342 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
343 }
344
345 /**
346 * @test
347 * @see DataSet/copyPageFreeMode.csv
348 */
349 public function copyPageFreeMode()
350 {
351 parent::copyPageFreeMode();
352 $this->assertAssertionDataSet('copyPageFreeMode');
353
354 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
355 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
356 ->setTable(self::TABLE_Page)->setField('title')->setValues('Target'));
357 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
358 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #10'));
359 }
360
361 /**
362 * @test
363 * @see DataSet/localizePageRecord.csv
364 */
365 public function localizePage()
366 {
367 parent::localizePage();
368 $this->assertAssertionDataSet('localizePage');
369
370 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
371 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
372 ->setTable(self::TABLE_Page)->setField('title')->setValues('[Translate to Dansk:] Relations'));
373 }
374
375 /**
376 * @test
377 * @see DataSet/changePageRecordSorting.csv
378 */
379 public function changePageSorting()
380 {
381 parent::changePageSorting();
382 $this->assertAssertionDataSet('changePageSorting');
383
384 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
385 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
386 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
387 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
388 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
389 }
390
391 /**
392 * @test
393 * @see DataSet/movePageRecordToDifferentPage.csv
394 */
395 public function movePageToDifferentPage()
396 {
397 parent::movePageToDifferentPage();
398 $this->assertAssertionDataSet('movePageToDifferentPage');
399
400 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
401 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
402 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
403 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
404 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
405 }
406
407 /**
408 * @test
409 * @see DataSet/movePageRecordToDifferentPageAndChangeSorting.csv
410 */
411 public function movePageToDifferentPageAndChangeSorting()
412 {
413 parent::movePageToDifferentPageAndChangeSorting();
414 $this->assertAssertionDataSet('movePageToDifferentPageNChangeSorting');
415
416 $responseSectionsPage = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
417 $this->assertThat($responseSectionsPage, $this->getRequestSectionHasRecordConstraint()
418 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
419 $this->assertThat($responseSectionsPage, $this->getRequestSectionHasRecordConstraint()
420 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
421 $responseSectionsWebsite = $this->getFrontendResponse(self::VALUE_PageIdWebsite, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
422 $this->assertThat($responseSectionsWebsite, $this->getRequestSectionStructureHasRecordConstraint()
423 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
424 ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Relations', 'DataHandlerTest'));
425 }
426
427 /**
428 * @test
429 * @see DataSet/movePageRecordToDifferentPageAndCreatePageRecordAfterMovedPageRecord.csv
430 * @see http://forge.typo3.org/issues/33104
431 * @see http://forge.typo3.org/issues/55573
432 */
433 public function movePageToDifferentPageAndCreatePageAfterMovedPage()
434 {
435 parent::movePageToDifferentPageAndCreatePageAfterMovedPage();
436 $this->assertAssertionDataSet('movePageToDifferentPageNCreatePageAfterMovedPage');
437
438 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdWebsite, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
439 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
440 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
441 ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Testing #1', 'DataHandlerTest'));
442 }
443
444 /*************************************
445 * Copying page contents and sub-pages
446 *************************************/
447
448 /**
449 * @test
450 * @see DataSet/createContentAndCopyDraftPage.csv
451 */
452 public function createContentAndCopyDraftPage()
453 {
454 parent::createContentAndCopyDraftPage();
455 $this->assertAssertionDataSet('createContentAndCopyDraftPage');
456
457 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
458 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
459 ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
460 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
461 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
462 ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
463 }
464
465 /**
466 * @test
467 * @see DataSet/createContentAndCopyLivePage.csv
468 */
469 public function createContentAndCopyLivePage()
470 {
471 parent::createContentAndCopyLivePage();
472 $this->assertAssertionDataSet('createContentAndCopyLivePage');
473
474 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
475 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
476 ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
477 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
478 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
479 ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
480 }
481
482 /**
483 * @test
484 * @see DataSet/createPageAndCopyDraftParentPage.csv
485 */
486 public function createPageAndCopyDraftParentPage()
487 {
488 parent::createPageAndCopyDraftParentPage();
489 $this->assertAssertionDataSet('createPageAndCopyDraftParentPage');
490
491 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
492 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
493 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
494 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
495 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
496 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
497 }
498
499 /**
500 * @test
501 * @see DataSet/createPageAndCopyParentPage.csv
502 */
503 public function createPageAndCopyLiveParentPage()
504 {
505 parent::createPageAndCopyLiveParentPage();
506 $this->assertAssertionDataSet('createPageAndCopyLiveParentPage');
507
508 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
509 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
510 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
511 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
512 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
513 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
514 }
515
516 /**
517 * @test
518 * @see DataSet/createNestedPagesAndCopyDraftParentPage.csv
519 */
520 public function createNestedPagesAndCopyDraftParentPage()
521 {
522 parent::createNestedPagesAndCopyDraftParentPage();
523 $this->assertAssertionDataSet('createNestedPagesAndCopyDraftParentPage');
524
525 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
526 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
527 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
528 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
529 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
530 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
531 }
532
533 /**
534 * @test
535 * @see DataSet/createNestedPagesAndCopyParentPage.csv
536 */
537 public function createNestedPagesAndCopyLiveParentPage()
538 {
539 parent::createNestedPagesAndCopyLiveParentPage();
540 $this->assertAssertionDataSet('createNestedPagesAndCopyLiveParentPage');
541
542 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
543 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
544 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
545 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
546 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
547 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
548 }
549
550 /**
551 * @test
552 * @see DataSet/deleteContentAndCopyDraftPage.csv
553 */
554 public function deleteContentAndCopyDraftPage()
555 {
556 parent::deleteContentAndCopyDraftPage();
557 $this->assertAssertionDataSet('deleteContentAndCopyDraftPage');
558
559 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
560 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
561 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
562 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
563 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
564 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
565 }
566
567 /**
568 * @test
569 * @see DataSet/deleteContentAndCopyLivePage.csv
570 */
571 public function deleteContentAndCopyLivePage()
572 {
573 parent::deleteContentAndCopyLivePage();
574 $this->assertAssertionDataSet('deleteContentAndCopyLivePage');
575
576 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
577 $this->assertThat($responseSectionsLive, $this->getRequestSectionHasRecordConstraint()
578 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
579 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
580 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
581 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
582 }
583
584 /**
585 * @test
586 * @see DataSet/changeContentSortingAndCopyDraftPage.csv
587 * @group mysql
588 * @todo Analyse PostgreSQL issues further, which is a generic issue
589 */
590 public function changeContentSortingAndCopyDraftPage()
591 {
592 parent::changeContentSortingAndCopyDraftPage();
593 $this->assertAssertionDataSet('changeContentSortingAndCopyDraftPage');
594
595 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
596 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
597 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
598 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
599 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
600 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
601 }
602
603 /**
604 * @test
605 * @see DataSet/changeContentSortingAndCopyLivePage.csv
606 */
607 public function changeContentSortingAndCopyLivePage()
608 {
609 parent::changeContentSortingAndCopyLivePage();
610 $this->assertAssertionDataSet('changeContentSortingAndCopyLivePage');
611
612 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
613 $this->assertThat($responseSectionsLive, $this->getRequestSectionHasRecordConstraint()
614 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
615 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
616 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
617 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
618 }
619
620 /**
621 * @test
622 * @see DataSet/moveContentAndCopyDraftPage.csv
623 */
624 public function moveContentAndCopyDraftPage()
625 {
626 parent::moveContentAndCopyDraftPage();
627 $this->assertAssertionDataSet('moveContentAndCopyDraftPage');
628
629 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
630 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
631 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0', 'Regular Element #2'));
632 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
633 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
634 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
635 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
636 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0'));
637 }
638
639 /**
640 * @test
641 * @see DataSet/moveContentAndCopyLivePage.csv
642 */
643 public function moveContentAndCopyLivePage()
644 {
645 parent::moveContentAndCopyLivePage();
646 $this->assertAssertionDataSet('moveContentAndCopyLivePage');
647
648 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
649 $this->assertThat($responseSectionsLive, $this->getRequestSectionHasRecordConstraint()
650 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
651 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
652 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0'));
653 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
654 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
655 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
656 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
657 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0'));
658 }
659
660 /**
661 * @test
662 * @see DataSet/createPlaceholdersAndDeleteDraftParentPage.csv
663 */
664 public function createPlaceholdersAndDeleteDraftParentPage()
665 {
666 parent::createPlaceholdersAndDeleteDraftParentPage();
667 $this->assertAssertionDataSet('createPlaceholdersAndDeleteDraftParentPage');
668 }
669
670 /**
671 * @test
672 * @see DataSet/createPlaceholdersAndDeleteLiveParentPage.csv
673 */
674 public function createPlaceholdersAndDeleteLiveParentPage()
675 {
676 parent::createPlaceholdersAndDeleteLiveParentPage();
677 $this->assertAssertionDataSet('createPlaceholdersAndDeleteLiveParentPage');
678 }
679 }