[BUGFIX] Make checks in localize compatible with new Localization Wizard
[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/Assertion/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/Assertion/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/Assertion/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/Assertion/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/Assertion/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/Assertion/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/Assertion/localizeContentRecord.csv
136 */
137 public function localizeContent()
138 {
139 parent::localizeContent();
140 $this->assertAssertionDataSet('localizeContent');
141
142 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
143 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
144 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
145 }
146
147 /**
148 * @test
149 * @see DataSet/localizeContentFromNonDefaultLanguage.csv
150 */
151 public function localizeContentFromNonDefaultLanguage()
152 {
153 parent::localizeContentFromNonDefaultLanguage();
154
155 $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
156
157 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
158 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
159 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', '[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
160 }
161
162 /**
163 * @test
164 * @see DataSet/Assertion/changeContentRecordSorting.csv
165 */
166 public function changeContentSorting()
167 {
168 parent::changeContentSorting();
169 $this->assertAssertionDataSet('changeContentSorting');
170
171 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
172 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
173 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
174 }
175
176 /**
177 * @test
178 * @see DataSet/changeContentSortingNDeleteMovedRecord.csv
179 */
180 public function changeContentSortingAndDeleteMovedRecord()
181 {
182 parent::changeContentSortingAndDeleteMovedRecord();
183 $this->assertAssertionDataSet('changeContentSortingNDeleteMovedRecord');
184
185 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
186 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
187 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
188 }
189
190 /**
191 * @test
192 * @see DataSet/changeContentSortingNDeleteLiveRecord.csv
193 */
194 public function changeContentSortingAndDeleteLiveRecord()
195 {
196 parent::changeContentSortingAndDeleteLiveRecord();
197 $this->assertAssertionDataSet('changeContentSortingNDeleteLiveRecord');
198
199 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
200 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
201 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
202 $this->assertThat($responseSections, $this->getRequestSectionDoesNotHaveRecordConstraint()
203 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
204 }
205
206 /**
207 * @test
208 * @see DataSet/Assertion/moveContentRecordToDifferentPage.csv
209 */
210 public function moveContentToDifferentPage()
211 {
212 parent::moveContentToDifferentPage();
213 $this->assertAssertionDataSet('moveContentToDifferentPage');
214
215 $responseSectionsSource = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
216 $this->assertThat($responseSectionsSource, $this->getRequestSectionHasRecordConstraint()
217 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
218 $responseSectionsTarget = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
219 $this->assertThat($responseSectionsTarget, $this->getRequestSectionHasRecordConstraint()
220 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
221 }
222
223 /**
224 * @test
225 * @see DataSet/Assertion/moveContentRecordToDifferentPageAndChangeSorting.csv
226 */
227 public function moveContentToDifferentPageAndChangeSorting()
228 {
229 parent::moveContentToDifferentPageAndChangeSorting();
230 $this->assertAssertionDataSet('moveContentToDifferentPageNChangeSorting');
231
232 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdTarget, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
233 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
234 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
235 }
236
237 /**
238 * Page records
239 */
240
241 /**
242 * @test
243 * @see DataSet/Assertion/createPageRecord.csv
244 */
245 public function createPage()
246 {
247 parent::createPage();
248 $this->assertAssertionDataSet('createPage');
249
250 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
251 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
252 ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
253 }
254
255 /**
256 * @test
257 * @see DataSet/Assertion/modifyPageRecord.csv
258 */
259 public function modifyPage()
260 {
261 parent::modifyPage();
262 $this->assertAssertionDataSet('modifyPage');
263
264 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
265 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
266 ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
267 }
268
269 /**
270 * @test
271 * @see DataSet/Assertion/deletePageRecord.csv
272 */
273 public function deletePage()
274 {
275 parent::deletePage();
276 $this->assertAssertionDataSet('deletePage');
277
278 $response = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId, false);
279 $this->assertContains('RuntimeException', $response->getError());
280 }
281
282 /**
283 * @test
284 * @see DataSet/Assertion/copyPageRecord.csv
285 */
286 public function copyPage()
287 {
288 parent::copyPage();
289 $this->assertAssertionDataSet('copyPage');
290
291 $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
292 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
293 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
294 }
295
296 /**
297 * @test
298 * @see DataSet/Assertion/localizePageRecord.csv
299 */
300 public function localizePage()
301 {
302 parent::localizePage();
303 $this->assertAssertionDataSet('localizePage');
304
305 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
306 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
307 ->setTable(self::TABLE_Page)->setField('title')->setValues('[Translate to Dansk:] Relations'));
308 }
309
310 /**
311 * @test
312 * @see DataSet/Assertion/changePageRecordSorting.csv
313 */
314 public function changePageSorting()
315 {
316 parent::changePageSorting();
317 $this->assertAssertionDataSet('changePageSorting');
318
319 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
320 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
321 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
322 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
323 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
324 }
325
326 /**
327 * @test
328 * @see DataSet/Assertion/movePageRecordToDifferentPage.csv
329 */
330 public function movePageToDifferentPage()
331 {
332 parent::movePageToDifferentPage();
333 $this->assertAssertionDataSet('movePageToDifferentPage');
334
335 $responseSections = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
336 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
337 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
338 $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
339 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
340 }
341
342 /**
343 * @test
344 * @see DataSet/Assertion/movePageRecordToDifferentPageAndChangeSorting.csv
345 */
346 public function movePageToDifferentPageAndChangeSorting()
347 {
348 parent::movePageToDifferentPageAndChangeSorting();
349 $this->assertAssertionDataSet('movePageToDifferentPageNChangeSorting');
350
351 $responseSectionsPage = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
352 $this->assertThat($responseSectionsPage, $this->getRequestSectionHasRecordConstraint()
353 ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
354 $this->assertThat($responseSectionsPage, $this->getRequestSectionHasRecordConstraint()
355 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
356 $responseSectionsWebsite = $this->getFrontendResponse(self::VALUE_PageIdWebsite, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
357 $this->assertThat($responseSectionsWebsite, $this->getRequestSectionStructureHasRecordConstraint()
358 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
359 ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Relations', 'DataHandlerTest'));
360 }
361
362 /**
363 * @test
364 * @see DataSet/Assertion/movePageRecordToDifferentPageAndCreatePageRecordAfterMovedPageRecord.csv
365 * @see http://forge.typo3.org/issues/33104
366 * @see http://forge.typo3.org/issues/55573
367 */
368 public function movePageToDifferentPageAndCreatePageAfterMovedPage()
369 {
370 parent::movePageToDifferentPageAndCreatePageAfterMovedPage();
371 $this->assertAssertionDataSet('movePageToDifferentPageNCreatePageAfterMovedPage');
372
373 $responseSections = $this->getFrontendResponse(self::VALUE_PageIdWebsite, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
374 $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
375 ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
376 ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Testing #1', 'DataHandlerTest'));
377 }
378
379 /*************************************
380 * Copying page contents and sub-pages
381 *************************************/
382
383 /**
384 * @test
385 * @see DataSet/createContentAndCopyDraftPage.csv
386 */
387 public function createContentAndCopyDraftPage()
388 {
389 parent::createContentAndCopyDraftPage();
390 $this->assertAssertionDataSet('createContentAndCopyDraftPage');
391
392 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
393 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
394 ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
395 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
396 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
397 ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
398 }
399
400 /**
401 * @test
402 * @see DataSet/createContentAndCopyLivePage.csv
403 */
404 public function createContentAndCopyLivePage()
405 {
406 parent::createContentAndCopyLivePage();
407 $this->assertAssertionDataSet('createContentAndCopyLivePage');
408
409 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
410 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
411 ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
412 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
413 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
414 ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
415 }
416
417 /**
418 * @test
419 * @see DataSet/createPageAndCopyDraftParentPage.csv
420 */
421 public function createPageAndCopyDraftParentPage()
422 {
423 parent::createPageAndCopyDraftParentPage();
424 $this->assertAssertionDataSet('createPageAndCopyDraftParentPage');
425
426 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
427 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
428 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
429 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
430 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
431 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
432 }
433
434 /**
435 * @test
436 * @see DataSet/createPageAndCopyParentPage.csv
437 */
438 public function createPageAndCopyLiveParentPage()
439 {
440 parent::createPageAndCopyLiveParentPage();
441 $this->assertAssertionDataSet('createPageAndCopyLiveParentPage');
442
443 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
444 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
445 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
446 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
447 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
448 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
449 }
450
451 /**
452 * @test
453 * @see DataSet/createNestedPagesAndCopyDraftParentPage.csv
454 */
455 public function createNestedPagesAndCopyDraftParentPage()
456 {
457 parent::createNestedPagesAndCopyDraftParentPage();
458 $this->assertAssertionDataSet('createNestedPagesAndCopyDraftParentPage');
459
460 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
461 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
462 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
463 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
464 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
465 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
466 }
467
468 /**
469 * @test
470 * @see DataSet/createNestedPagesAndCopyParentPage.csv
471 */
472 public function createNestedPagesAndCopyLiveParentPage()
473 {
474 parent::createNestedPagesAndCopyLiveParentPage();
475 $this->assertAssertionDataSet('createNestedPagesAndCopyLiveParentPage');
476
477 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
478 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
479 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
480 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
481 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
482 ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
483 }
484
485 /**
486 * @test
487 * @see DataSet/deleteContentAndCopyDraftPage.csv
488 */
489 public function deleteContentAndCopyDraftPage()
490 {
491 parent::deleteContentAndCopyDraftPage();
492 $this->assertAssertionDataSet('deleteContentAndCopyDraftPage');
493
494 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
495 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
496 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
497 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
498 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
499 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
500 }
501
502 /**
503 * @test
504 * @see DataSet/deleteContentAndCopyLivePage.csv
505 */
506 public function deleteContentAndCopyLivePage()
507 {
508 parent::deleteContentAndCopyLivePage();
509 $this->assertAssertionDataSet('deleteContentAndCopyLivePage');
510
511 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
512 $this->assertThat($responseSectionsLive, $this->getRequestSectionHasRecordConstraint()
513 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
514 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
515 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
516 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
517 }
518
519 /**
520 * @test
521 * @see DataSet/changeContentSortingAndCopyDraftPage.csv
522 */
523 public function changeContentSortingAndCopyDraftPage()
524 {
525 parent::changeContentSortingAndCopyDraftPage();
526 $this->assertAssertionDataSet('changeContentSortingAndCopyDraftPage');
527
528 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
529 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
530 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
531 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
532 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
533 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
534 }
535
536 /**
537 * @test
538 * @see DataSet/changeContentSortingAndCopyLivePage.csv
539 */
540 public function changeContentSortingAndCopyLivePage()
541 {
542 parent::changeContentSortingAndCopyLivePage();
543 $this->assertAssertionDataSet('changeContentSortingAndCopyLivePage');
544
545 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
546 $this->assertThat($responseSectionsLive, $this->getRequestSectionHasRecordConstraint()
547 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
548 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
549 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
550 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
551 }
552
553 /**
554 * @test
555 * @see DataSet/moveContentAndCopyDraftPage.csv
556 */
557 public function moveContentAndCopyDraftPage()
558 {
559 parent::moveContentAndCopyDraftPage();
560 $this->assertAssertionDataSet('moveContentAndCopyDraftPage');
561
562 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
563 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
564 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0', 'Regular Element #2'));
565 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
566 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
567 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
568 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
569 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0'));
570 }
571
572 /**
573 * @test
574 * @see DataSet/moveContentAndCopyLivePage.csv
575 */
576 public function moveContentAndCopyLivePage()
577 {
578 parent::moveContentAndCopyLivePage();
579 $this->assertAssertionDataSet('moveContentAndCopyLivePage');
580
581 $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
582 $this->assertThat($responseSectionsLive, $this->getRequestSectionHasRecordConstraint()
583 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
584 $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
585 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0'));
586 $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
587 $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
588 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
589 $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
590 ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0'));
591 }
592
593 /**
594 * @test
595 * @see DataSet/createPlaceholdersAndDeleteDraftParentPage.csv
596 */
597 public function createPlaceholdersAndDeleteDraftParentPage()
598 {
599 parent::createPlaceholdersAndDeleteDraftParentPage();
600 $this->assertAssertionDataSet('createPlaceholdersAndDeleteDraftParentPage');
601 }
602
603 /**
604 * @test
605 * @see DataSet/createPlaceholdersAndDeleteLiveParentPage.csv
606 */
607 public function createPlaceholdersAndDeleteLiveParentPage()
608 {
609 parent::createPlaceholdersAndDeleteLiveParentPage();
610 $this->assertAssertionDataSet('createPlaceholdersAndDeleteLiveParentPage');
611 }
612 }