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