‪TYPO3CMS  10.4
ActionTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
20 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequestContext;
21 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
22 
27 {
31  protected ‪$assertionDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/DataSet/';
32 
36  protected ‪$assertCleanReferenceIndex = false;
37 
41  public function ‪createContents()
42  {
43  parent::createContents();
44  $this->‪assertAssertionDataSet('createContents');
45 
46  $response = $this->executeFrontendRequest(
47  (new InternalRequest())->withPageId(self::VALUE_PageId),
48  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
49  );
50  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
51  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
52  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', 'Testing #2'));
53  }
54 
58  public function ‪createContentAndCopyContent()
59  {
60  parent::createContentAndCopyContent();
61  $this->‪assertAssertionDataSet('createContentAndCopyContent');
62 
63  $response = $this->executeFrontendRequest(
64  (new InternalRequest())->withPageId(self::VALUE_PageId),
65  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
66  );
67  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
68  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
69  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', 'Testing #1 (copy 1)'));
70  }
71 
75  public function ‪createContentAndLocalize()
76  {
77  parent::createContentAndLocalize();
78  $this->‪assertAssertionDataSet('createContentAndLocalize');
79 
80  $response = $this->executeFrontendRequest(
81  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
82  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
83  );
84  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
85  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
86  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
87  }
88 
92  public function ‪modifyContent()
93  {
94  parent::modifyContent();
95  $this->‪assertAssertionDataSet('modifyContent');
96 
97  $response = $this->executeFrontendRequest(
98  (new InternalRequest())->withPageId(self::VALUE_PageId),
99  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
100  );
101  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
102  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
103  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
104  }
105 
109  public function ‪hideContent()
110  {
111  parent::hideContent();
112  $this->‪assertAssertionDataSet('hideContent');
113 
114  $response = $this->executeFrontendRequest(
115  (new InternalRequest())->withPageId(self::VALUE_PageId),
116  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
117  );
118  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
119  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
120  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
121  }
122 
126  public function ‪hideContentAndMoveToDifferentPage()
127  {
128  parent::hideContent();
129  parent::moveContentToDifferentPage();
130  $this->‪assertAssertionDataSet('hideContentAndMoveToDifferentPage');
131 
132  $response = $this->executeFrontendRequest(
133  (new InternalRequest())->withPageId(self::VALUE_PageId),
134  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
135  );
136  $responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
137  self::assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
138  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
139  self::assertThat($responseSectionsSource, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
140  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
141  $response = $this->executeFrontendRequest(
142  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget),
143  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
144  );
145  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
146  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
147  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
148  }
149 
153  public function ‪deleteContent()
154  {
155  parent::deleteContent();
156  $this->‪assertAssertionDataSet('deleteContent');
157 
158  $response = $this->executeFrontendRequest(
159  (new InternalRequest())->withPageId(self::VALUE_PageId),
160  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
161  );
162  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
163  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
164  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
165  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
166  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
167  }
168 
173  {
174  // Create translated page first
175  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
176  parent::deleteLocalizedContentAndDeleteContent();
177  $this->‪assertAssertionDataSet('deleteLocalizedContentNDeleteContent');
178 
179  $response = $this->executeFrontendRequest(
180  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
181  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
182  );
183  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
184  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
185  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #3', '[Translate to Dansk:] Regular Element #3', 'Regular Element #1'));
186  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
187  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', 'Regular Element #2'));
188  }
189 
193  public function ‪copyContent()
194  {
195  parent::copyContent();
196  $this->‪assertAssertionDataSet('copyContent');
197 
198  $response = $this->executeFrontendRequest(
199  (new InternalRequest())->withPageId(self::VALUE_PageId),
200  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
201  );
202  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
203  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
204  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2 (copy 1)'));
205  }
206 
210  public function ‪copyContentToLanguage()
211  {
212  // Create translated page first
213  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
214  parent::copyContentToLanguage();
215  $this->‪assertAssertionDataSet('copyContentToLanguage');
216 
217  // Set up "dk" to not have overlays
218  $languageConfiguration = ‪$this->siteLanguageConfiguration;
219  $languageConfiguration[‪self::VALUE_LanguageId]['fallbackType'] = 'free';
220  $this->‪setUpFrontendSite(1, $languageConfiguration);
221  $response = $this->executeFrontendRequest(
222  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
223  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
224  );
225  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
226  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
227  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2'));
228  }
229 
234  {
235  // Create translated page first
236  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
237  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
238  parent::copyContentToLanguageFromNonDefaultLanguage();
239  $this->‪assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage');
240 
241  // Set up "de" to not have overlays
242  $languageConfiguration = ‪$this->siteLanguageConfiguration;
243  $languageConfiguration[‪self::VALUE_LanguageIdSecond]['fallbackType'] = 'free';
244  $this->‪setUpFrontendSite(1, $languageConfiguration);
245  $response = $this->executeFrontendRequest(
246  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond),
247  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
248  );
249  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
250  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
251  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
252  }
253 
257  public function ‪localizeContent()
258  {
259  // Create translated page first
260  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
261  parent::localizeContent();
262  $this->‪assertAssertionDataSet('localizeContent');
263 
264  $response = $this->executeFrontendRequest(
265  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
266  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
267  );
268  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
269  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
270  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
271  }
272 
276  public function ‪localizeContentAfterMovedContent()
277  {
278  parent::localizeContentAfterMovedContent();
279  $this->‪assertAssertionDataSet('localizeContentAfterMovedContent');
280  }
281 
286  {
287  parent::localizeContentAfterMovedInLiveContent();
288  $this->‪assertAssertionDataSet('localizeContentAfterMovedInLiveContent');
289  }
290 
296  {
297  parent::localizeContentWithEmptyTcaIntegrityColumns();
298  $this->‪assertAssertionDataSet('localizeContentWithEmptyTcaIntegrityColumns');
299  $response = $this->executeFrontendRequest(
300  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
301  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
302  );
303  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
304  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
305  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
306  }
307 
311  public function ‪localizeContentWithHideAtCopy()
312  {
313  // Create translated page first
314  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
315  parent::localizeContentWithHideAtCopy();
316  $this->‪assertAssertionDataSet('localizeContentWHideAtCopy');
317 
318  $response = $this->executeFrontendRequest(
319  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
320  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
321  );
322  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
323  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
324  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
325  }
326 
331  {
332  // Create translated page first
333  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
334  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
335  parent::localizeContentFromNonDefaultLanguage();
336 
337  $this->‪assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
338 
339  $response = $this->executeFrontendRequest(
340  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond),
341  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
342  );
343  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
344  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
345  ->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'));
346  }
347 
351  public function ‪changeContentSorting()
352  {
353  parent::changeContentSorting();
354  $this->‪assertAssertionDataSet('changeContentSorting');
355 
356  $response = $this->executeFrontendRequest(
357  (new InternalRequest())->withPageId(self::VALUE_PageId),
358  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
359  );
360  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
361  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
362  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
363  }
364 
368  public function ‪changeContentSortingAfterSelf()
369  {
370  parent::changeContentSortingAfterSelf();
371  $this->‪assertAssertionDataSet('changeContentSortingAfterSelf');
372 
373  $response = $this->executeFrontendRequest(
374  (new InternalRequest())->withPageId(self::VALUE_PageId),
375  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
376  );
377  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
378  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
379  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
380  }
381 
387  {
388  parent::changeContentSortingAndDeleteMovedRecord();
389  $this->‪assertAssertionDataSet('changeContentSortingNDeleteMovedRecord');
390 
391  $response = $this->executeFrontendRequest(
392  (new InternalRequest())->withPageId(self::VALUE_PageId),
393  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
394  );
395  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
396  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
397  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
398  }
399 
404  {
405  parent::changeContentSortingAndDeleteLiveRecord();
406  $this->‪assertAssertionDataSet('changeContentSortingNDeleteLiveRecord');
407 
408  $response = $this->executeFrontendRequest(
409  (new InternalRequest())->withPageId(self::VALUE_PageId),
410  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
411  );
412  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
413  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
414  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
415  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
416  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
417  }
418 
422  public function ‪moveContentToDifferentPage()
423  {
424  parent::moveContentToDifferentPage();
425  $this->‪assertAssertionDataSet('moveContentToDifferentPage');
426 
427  $response = $this->executeFrontendRequest(
428  (new InternalRequest())->withPageId(self::VALUE_PageId),
429  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
430  );
431  $responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
432  self::assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
433  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
434  $response = $this->executeFrontendRequest(
435  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget),
436  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
437  );
438  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
439  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionHasRecordConstraint()
440  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
441  }
442 
447  {
448  parent::moveContentToDifferentPageAndChangeSorting();
449  $this->‪assertAssertionDataSet('moveContentToDifferentPageNChangeSorting');
450 
451  $response = $this->executeFrontendRequest(
452  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget),
453  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
454  );
455  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
456  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
457  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
458  }
459 
463  public function ‪moveContentToDifferentPageAndHide()
464  {
465  parent::moveContentToDifferentPageAndHide();
466  $this->‪assertAssertionDataSet('moveContentToDifferentPageAndHide');
467 
468  $response = $this->executeFrontendRequest(
469  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget),
470  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
471  );
472  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
473  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
474  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
475  }
476 
484  public function ‪createPage()
485  {
486  parent::createPage();
487  $this->‪assertAssertionDataSet('createPage');
488 
489  $response = $this->executeFrontendRequest(
490  (new InternalRequest())->withPageId($this->recordIds['newPageId']),
491  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
492  );
493  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
494  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
495  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
496  }
497 
502  {
503  parent::createPageAndSubPageAndSubPageContent();
504  $this->‪assertAssertionDataSet('createPageAndSubPageAndSubPageContent');
505 
506  $response = $this->executeFrontendRequest(
507  (new InternalRequest())->withPageId($this->recordIds['newSubPageId']),
508  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
509  );
510  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
511  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
512  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1 #1'));
513  }
514 
519  {
520  parent::createPageAndContentWithTcaDefaults();
521  $this->‪assertAssertionDataSet('createPageNContentWDefaults');
522 
523  // first, assert that page cannot be opened without using backend user (since it's hidden)
524  $response = $this->executeFrontendRequest(
525  (new InternalRequest())
526  ->withPageId($this->recordIds['newPageId'])
527  );
528  self::assertSame(404, $response->getStatusCode());
529 
530  // then, assert if preview is possible using a backend user
531  $response = $this->executeFrontendRequest(
532  (new InternalRequest())
533  ->withPageId($this->recordIds['newPageId']),
534  (new InternalRequestContext())
535  ->withBackendUserId(self::VALUE_BackendUserId)
536  ->withWorkspaceId(self::VALUE_WorkspaceId)
537  );
538  $responseSections = ResponseContent::fromString((string)$response->getBody())
539  ->getSections();
540  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
541  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
542  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
543  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
544  }
545 
549  public function ‪modifyPage()
550  {
551  parent::modifyPage();
552  $this->‪assertAssertionDataSet('modifyPage');
553 
554  $response = $this->executeFrontendRequest(
555  (new InternalRequest())->withPageId(self::VALUE_PageId),
556  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
557  );
558  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
559  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
560  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
561  }
562 
566  public function ‪deletePage()
567  {
568  parent::deletePage();
569  $this->‪assertAssertionDataSet('deletePage');
570 
571  $response = $this->executeFrontendRequest(
572  (new InternalRequest())->withPageId(self::VALUE_PageId),
573  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
574  );
575  self::assertEquals(404, $response->getStatusCode());
576  }
577 
581  public function ‪deleteContentAndPage()
582  {
583  parent::deleteContentAndPage();
584  $this->‪assertAssertionDataSet('deleteContentAndPage');
585 
586  $response = $this->executeFrontendRequest(
587  (new InternalRequest())->withPageId(self::VALUE_PageId),
588  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
589  );
590  self::assertEquals(404, $response->getStatusCode());
591  }
592 
598  {
599  // Create localized page and localize content elements first
600  parent::localizePageAndContentsAndDeletePageLocalization();
601  $this->‪assertAssertionDataSet('localizePageAndContentsAndDeletePageLocalization');
602 
603  $response = $this->executeFrontendRequest(
604  (new InternalRequest())->withPageId($this->recordIds['localizedPageId']),
605  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
606  );
607  self::assertEquals(404, $response->getStatusCode());
608  }
609 
613  public function ‪localizeNestedPagesAndContents()
614  {
615  parent::localizeNestedPagesAndContents();
616  $this->‪assertAssertionDataSet('localizeNestedPagesAndContents');
617  }
618 
622  public function ‪copyPage()
623  {
624  parent::copyPage();
625  $this->‪assertAssertionDataSet('copyPage');
626 
627  $response = $this->executeFrontendRequest(
628  (new InternalRequest())->withPageId($this->recordIds['newPageId']),
629  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
630  );
631  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
632  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
633  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
634  }
635 
639  public function ‪copyPageFreeMode()
640  {
641  parent::copyPageFreeMode();
642  $this->‪assertAssertionDataSet('copyPageFreeMode');
643 
644  $response = $this->executeFrontendRequest(
645  (new InternalRequest())->withPageId($this->recordIds['newPageId']),
646  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
647  );
648  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
649  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
650  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target'));
651  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
652  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #10'));
653  }
654 
658  public function ‪localizePage()
659  {
660  parent::localizePage();
661  $this->‪assertAssertionDataSet('localizePage');
662 
663  $response = $this->executeFrontendRequest(
664  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
665  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
666  );
667  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
668  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
669  ->setTable(self::TABLE_Page)->setField('title')->setValues('[Translate to Dansk:] Relations'));
670  }
671 
675  public function ‪createPageAndChangePageSorting()
676  {
677  parent::createPageAndChangePageSorting();
678  $this->‪assertAssertionDataSet('createPageAndChangePageSorting');
679  }
680 
684  public function ‪createPageAndMoveCreatedPage()
685  {
686  parent::createPageAndMoveCreatedPage();
687  $this->‪assertAssertionDataSet('createPageAndMoveCreatedPage');
688  }
689 
693  public function ‪changePageSorting()
694  {
695  parent::changePageSorting();
696  $this->‪assertAssertionDataSet('changePageSorting');
697 
698  $response = $this->executeFrontendRequest(
699  (new InternalRequest())->withPageId(self::VALUE_PageId),
700  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
701  );
702  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
703  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
704  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
705  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
706  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
707  }
708 
712  public function ‪changePageSortingAfterSelf()
713  {
714  parent::changePageSortingAfterSelf();
715  $this->‪assertAssertionDataSet('changePageSortingAfterSelf');
716 
717  $response = $this->executeFrontendRequest(
718  (new InternalRequest())->withPageId(self::VALUE_PageId),
719  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
720  );
721  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
722  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
723  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
724  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
725  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
726  }
727 
731  public function ‪movePageToDifferentPage()
732  {
733  parent::movePageToDifferentPage();
734  $this->‪assertAssertionDataSet('movePageToDifferentPage');
735 
736  $response = $this->executeFrontendRequest(
737  (new InternalRequest())->withPageId(self::VALUE_PageId),
738  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
739  );
740  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
741  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
742  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
743  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
744  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
745  }
746 
750  public function ‪movePageToDifferentPageTwice()
751  {
752  parent::movePageToDifferentPageTwice();
753  $this->‪assertAssertionDataSet('movePageToDifferentPageTwice');
754  }
755 
760  {
761  parent::movePageLocalizedToDifferentPageTwice();
762  $this->‪assertAssertionDataSet('movePageLocalizedToDifferentPageTwice');
763  }
764 
769  {
770  parent::movePageLocalizedInLiveToDifferentPageTwice();
771  $this->‪assertAssertionDataSet('movePageLocalizedInLiveToDifferentPageTwice');
772  }
773 
778  {
779  parent::movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice();
780  $this->‪assertAssertionDataSet('movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice');
781  }
782 
787  {
788  parent::movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice();
789  $this->‪assertAssertionDataSet('movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice');
790  }
791 
796  {
797  parent::movePageToDifferentPageAndChangeSorting();
798  $this->‪assertAssertionDataSet('movePageToDifferentPageNChangeSorting');
799 
800  $response = $this->executeFrontendRequest(
801  (new InternalRequest())->withPageId(self::VALUE_PageId),
802  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
803  );
804  $responseSectionsPage = ResponseContent::fromString((string)$response->getBody())->getSections();
805  self::assertThat($responseSectionsPage, $this->‪getRequestSectionHasRecordConstraint()
806  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
807  self::assertThat($responseSectionsPage, $this->‪getRequestSectionHasRecordConstraint()
808  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
809  $response = $this->executeFrontendRequest(
810  (new InternalRequest())->withPageId(self::VALUE_PageIdWebsite),
811  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
812  );
813  $responseSectionsWebsite = ResponseContent::fromString((string)$response->getBody())->getSections();
814  self::assertThat($responseSectionsWebsite, $this->‪getRequestSectionStructureHasRecordConstraint()
815  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
816  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Relations', 'DataHandlerTest'));
817  }
818 
825  {
826  parent::movePageToDifferentPageAndCreatePageAfterMovedPage();
827  $this->‪assertAssertionDataSet('movePageToDifferentPageNCreatePageAfterMovedPage');
828 
829  $response = $this->executeFrontendRequest(
830  (new InternalRequest())->withPageId(self::VALUE_PageIdWebsite),
831  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
832  );
833  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
834  self::assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
835  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
836  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Testing #1', 'DataHandlerTest'));
837  }
838 
839  /*************************************
840  * Copying page contents and sub-pages
841  *************************************/
842 
846  public function ‪createContentAndCopyDraftPage()
847  {
848  parent::createContentAndCopyDraftPage();
849  $this->‪assertAssertionDataSet('createContentAndCopyDraftPage');
850 
851  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
852  self::assertStringContainsString('The requested page does not exist', (string)$response->getBody());
853  $response = $this->executeFrontendRequest(
854  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
855  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
856  );
857  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
858  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
859  ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
860  }
861 
866  public function ‪createContentAndCopyLivePage()
867  {
868  parent::createContentAndCopyLivePage();
869  $this->‪assertAssertionDataSet('createContentAndCopyLivePage');
870 
871  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
872  $responseSectionsLive = ResponseContent::fromString((string)$response->getBody())->getSections();
873  self::assertThat($responseSectionsLive, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
874  ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
875  $response = $this->executeFrontendRequest(
876  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
877  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
878  );
879  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
880  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
881  ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
882  }
883 
887  public function ‪createPageAndCopyDraftParentPage()
888  {
889  parent::createPageAndCopyDraftParentPage();
890  $this->‪assertAssertionDataSet('createPageAndCopyDraftParentPage');
891 
892  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
893  self::assertStringContainsString('The requested page does not exist', (string)$response->getBody());
894  $response = $this->executeFrontendRequest(
895  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
896  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
897  );
898  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
899  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
900  ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
901  }
902 
907  public function ‪createPageAndCopyLiveParentPage()
908  {
909  parent::createPageAndCopyLiveParentPage();
910  $this->‪assertAssertionDataSet('createPageAndCopyLiveParentPage');
911 
912  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
913  $responseSectionsLive = ResponseContent::fromString((string)$response->getBody())->getSections();
914  self::assertThat($responseSectionsLive, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
915  ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
916  $response = $this->executeFrontendRequest(
917  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
918  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
919  );
920  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
921  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
922  ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
923  }
924 
930  {
931  parent::createNestedPagesAndCopyDraftParentPage();
932  $this->‪assertAssertionDataSet('createNestedPagesAndCopyDraftParentPage');
933 
934  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
935  self::assertStringContainsString('The requested page does not exist', (string)$response->getBody());
936  $response = $this->executeFrontendRequest(
937  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
938  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
939  );
940  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
941  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
942  ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
943  }
944 
950  {
951  parent::createNestedPagesAndCopyLiveParentPage();
952  $this->‪assertAssertionDataSet('createNestedPagesAndCopyLiveParentPage');
953 
954  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
955  $responseSectionsLive = ResponseContent::fromString((string)$response->getBody())->getSections();
956  self::assertThat($responseSectionsLive, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
957  ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
958  $response = $this->executeFrontendRequest(
959  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
960  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
961  );
962  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
963  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
964  ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
965  }
966 
971  public function ‪deleteContentAndCopyDraftPage()
972  {
973  parent::deleteContentAndCopyDraftPage();
974  $this->‪assertAssertionDataSet('deleteContentAndCopyDraftPage');
975 
976  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
977  self::assertStringContainsString('The requested page does not exist', (string)$response->getBody());
978  $response = $this->executeFrontendRequest(
979  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
980  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
981  );
982  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
983  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
984  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
985  }
986 
991  public function ‪deleteContentAndCopyLivePage()
992  {
993  parent::deleteContentAndCopyLivePage();
994  $this->‪assertAssertionDataSet('deleteContentAndCopyLivePage');
995 
996  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
997  $responseSectionsLive = ResponseContent::fromString((string)$response->getBody())->getSections();
998  self::assertThat($responseSectionsLive, $this->‪getRequestSectionHasRecordConstraint()
999  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
1000  $response = $this->executeFrontendRequest(
1001  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
1002  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
1003  );
1004  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
1005  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
1006  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
1007  }
1008 
1013  public function ‪changeContentSortingAndCopyDraftPage()
1014  {
1015  parent::changeContentSortingAndCopyDraftPage();
1016  $this->‪assertAssertionDataSet('changeContentSortingAndCopyDraftPage');
1017 
1018  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
1019  self::assertStringContainsString('The requested page does not exist', (string)$response->getBody());
1020  $response = $this->executeFrontendRequest(
1021  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
1022  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
1023  );
1024  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
1025  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
1026  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
1027  }
1028 
1033  public function ‪changeContentSortingAndCopyLivePage()
1034  {
1035  parent::changeContentSortingAndCopyLivePage();
1036  $this->‪assertAssertionDataSet('changeContentSortingAndCopyLivePage');
1037 
1038  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
1039  $responseSectionsLive = ResponseContent::fromString((string)$response->getBody())->getSections();
1040  self::assertThat($responseSectionsLive, $this->‪getRequestSectionHasRecordConstraint()
1041  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
1042  $response = $this->executeFrontendRequest(
1043  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
1044  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
1045  );
1046  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
1047  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
1048  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
1049  }
1050 
1055  public function ‪moveContentAndCopyDraftPage()
1056  {
1057  parent::moveContentAndCopyDraftPage();
1058  $this->‪assertAssertionDataSet('moveContentAndCopyDraftPage');
1059 
1060  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
1061  self::assertStringContainsString('The requested page does not exist', (string)$response->getBody());
1062  $response = $this->executeFrontendRequest(
1063  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
1064  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
1065  );
1066  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
1067  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
1068  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
1069  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
1070  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0'));
1071  }
1072 
1077  public function ‪moveContentAndCopyLivePage()
1078  {
1079  parent::moveContentAndCopyLivePage();
1080  $this->‪assertAssertionDataSet('moveContentAndCopyLivePage');
1081 
1082  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['copiedPageId']));
1083  $responseSectionsLive = ResponseContent::fromString((string)$response->getBody())->getSections();
1084  self::assertThat($responseSectionsLive, $this->‪getRequestSectionHasRecordConstraint()
1085  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
1086  self::assertThat($responseSectionsLive, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
1087  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0'));
1088  $response = $this->executeFrontendRequest(
1089  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
1090  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
1091  );
1092  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
1093  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
1094  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
1095  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
1096  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0'));
1097  }
1098 
1103  {
1104  parent::createPlaceholdersAndDeleteDraftParentPage();
1105  $this->‪assertAssertionDataSet('createPlaceholdersAndDeleteDraftParentPage');
1106  }
1107 
1113  {
1114  parent::createPlaceholdersAndDeleteLiveParentPage();
1115  $this->‪assertAssertionDataSet('createPlaceholdersAndDeleteLiveParentPage');
1116  }
1117 
1123  {
1124  // Create translated page first
1125  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
1126  // Have a hidden live content element
1127  $this->‪setWorkspaceId(0);
1128  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized, ['hidden' => 1]);
1129  $this->‪setWorkspaceId(self::VALUE_WorkspaceId);
1130  // Create a non-hidden workspace overlay
1131  $this->actionService->modifyRecord(self::TABLE_Content, self::VALUE_ContentIdThirdLocalized, ['hidden' => 0]);
1132  // Confirm db state is as expected for this scenario
1133  $this->‪assertAssertionDataSet('createLocalizedNotHiddenWorkspaceContentHiddenInLive');
1134  // Get the FE preview and verify content element is shown
1135  $response = $this->executeFrontendRequest(
1136  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
1137  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
1138  );
1139  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
1140  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
1141  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3'));
1142  }
1143 }
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPageAndCopyDraftParentPage
‪createPageAndCopyDraftParentPage()
Definition: ActionTest.php:885
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPage
‪createPage()
Definition: ActionTest.php:482
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPlaceholdersAndDeleteDraftParentPage
‪createPlaceholdersAndDeleteDraftParentPage()
Definition: ActionTest.php:1100
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyPage
‪copyPage()
Definition: ActionTest.php:620
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify
Definition: ActionTest.php:16
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest
Definition: ActionTest.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setUpFrontendSite
‪setUpFrontendSite(int $pageId, array $additionalLanguages=[])
Definition: AbstractDataHandlerActionTestCase.php:143
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionHasRecordConstraint
‪HasRecordConstraint getRequestSectionHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:289
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createNestedPagesAndCopyDraftParentPage
‪createNestedPagesAndCopyDraftParentPage()
Definition: ActionTest.php:927
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createLocalizedNotHiddenWorkspaceContentHiddenInLive
‪createLocalizedNotHiddenWorkspaceContentHiddenInLive()
Definition: ActionTest.php:1120
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\hideContent
‪hideContent()
Definition: ActionTest.php:107
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionStructureHasRecordConstraint
‪StructureHasRecordConstraint getRequestSectionStructureHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:305
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changeContentSortingAndCopyDraftPage
‪changeContentSortingAndCopyDraftPage()
Definition: ActionTest.php:1011
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentWithEmptyTcaIntegrityColumns
‪localizeContentWithEmptyTcaIntegrityColumns()
Definition: ActionTest.php:293
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizePage
‪localizePage()
Definition: ActionTest.php:656
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createNestedPagesAndCopyLiveParentPage
‪createNestedPagesAndCopyLiveParentPage()
Definition: ActionTest.php:947
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changePageSortingAfterSelf
‪changePageSortingAfterSelf()
Definition: ActionTest.php:710
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice
‪movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice()
Definition: ActionTest.php:775
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changeContentSortingAndCopyLivePage
‪changeContentSortingAndCopyLivePage()
Definition: ActionTest.php:1031
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\deleteContentAndCopyDraftPage
‪deleteContentAndCopyDraftPage()
Definition: ActionTest.php:969
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase\VALUE_LanguageId
‪const VALUE_LanguageId
Definition: AbstractActionTestCase.php:39
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createContentAndCopyContent
‪createContentAndCopyContent()
Definition: ActionTest.php:56
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changeContentSortingAfterSelf
‪changeContentSortingAfterSelf()
Definition: ActionTest.php:366
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeNestedPagesAndContents
‪localizeNestedPagesAndContents()
Definition: ActionTest.php:611
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changeContentSortingAndDeleteMovedRecord
‪changeContentSortingAndDeleteMovedRecord()
Definition: ActionTest.php:384
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPageAndCopyLiveParentPage
‪createPageAndCopyLiveParentPage()
Definition: ActionTest.php:905
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentFromNonDefaultLanguage
‪localizeContentFromNonDefaultLanguage()
Definition: ActionTest.php:328
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageLocalizedToDifferentPageTwice
‪movePageLocalizedToDifferentPageTwice()
Definition: ActionTest.php:757
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\deleteLocalizedContentAndDeleteContent
‪deleteLocalizedContentAndDeleteContent()
Definition: ActionTest.php:170
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentAfterMovedContent
‪localizeContentAfterMovedContent()
Definition: ActionTest.php:274
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyContent
‪copyContent()
Definition: ActionTest.php:191
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageToDifferentPageAndCreatePageAfterMovedPage
‪movePageToDifferentPageAndCreatePageAfterMovedPage()
Definition: ActionTest.php:822
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changePageSorting
‪changePageSorting()
Definition: ActionTest.php:691
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\deleteContentAndPage
‪deleteContentAndPage()
Definition: ActionTest.php:579
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\moveContentToDifferentPageAndHide
‪moveContentToDifferentPageAndHide()
Definition: ActionTest.php:461
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageLocalizedInLiveToDifferentPageTwice
‪movePageLocalizedInLiveToDifferentPageTwice()
Definition: ActionTest.php:766
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase\VALUE_LanguageIdSecond
‪const VALUE_LanguageIdSecond
Definition: AbstractActionTestCase.php:40
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\deleteContentAndCopyLivePage
‪deleteContentAndCopyLivePage()
Definition: ActionTest.php:989
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\$assertionDataSetDirectory
‪string $assertionDataSetDirectory
Definition: ActionTest.php:30
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\modifyContent
‪modifyContent()
Definition: ActionTest.php:90
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPageAndChangePageSorting
‪createPageAndChangePageSorting()
Definition: ActionTest.php:673
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContent
‪localizeContent()
Definition: ActionTest.php:255
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createContents
‪createContents()
Definition: ActionTest.php:39
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createContentAndLocalize
‪createContentAndLocalize()
Definition: ActionTest.php:73
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyPageFreeMode
‪copyPageFreeMode()
Definition: ActionTest.php:637
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\moveContentAndCopyDraftPage
‪moveContentAndCopyDraftPage()
Definition: ActionTest.php:1053
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageToDifferentPageTwice
‪movePageToDifferentPageTwice()
Definition: ActionTest.php:748
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyContentToLanguage
‪copyContentToLanguage()
Definition: ActionTest.php:208
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setWorkspaceId
‪setWorkspaceId(int $workspaceId)
Definition: AbstractDataHandlerActionTestCase.php:182
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPlaceholdersAndDeleteLiveParentPage
‪createPlaceholdersAndDeleteLiveParentPage()
Definition: ActionTest.php:1110
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createContentAndCopyDraftPage
‪createContentAndCopyDraftPage()
Definition: ActionTest.php:844
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\assertAssertionDataSet
‪assertAssertionDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:208
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageToDifferentPageAndChangeSorting
‪movePageToDifferentPageAndChangeSorting()
Definition: ActionTest.php:793
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changeContentSorting
‪changeContentSorting()
Definition: ActionTest.php:349
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionDoesNotHaveRecordConstraint
‪DoesNotHaveRecordConstraint getRequestSectionDoesNotHaveRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:297
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\deletePage
‪deletePage()
Definition: ActionTest.php:564
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyContentToLanguageFromNonDefaultLanguage
‪copyContentToLanguageFromNonDefaultLanguage()
Definition: ActionTest.php:231
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice
‪movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice()
Definition: ActionTest.php:784
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\hideContentAndMoveToDifferentPage
‪hideContentAndMoveToDifferentPage()
Definition: ActionTest.php:124
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentWithHideAtCopy
‪localizeContentWithHideAtCopy()
Definition: ActionTest.php:309
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createContentAndCopyLivePage
‪createContentAndCopyLivePage()
Definition: ActionTest.php:864
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\moveContentAndCopyLivePage
‪moveContentAndCopyLivePage()
Definition: ActionTest.php:1075
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPageAndContentWithTcaDefaults
‪createPageAndContentWithTcaDefaults()
Definition: ActionTest.php:516
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\$siteLanguageConfiguration
‪array $siteLanguageConfiguration
Definition: AbstractDataHandlerActionTestCase.php:86
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPageAndSubPageAndSubPageContent
‪createPageAndSubPageAndSubPageContent()
Definition: ActionTest.php:499
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\deleteContent
‪deleteContent()
Definition: ActionTest.php:151
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\modifyPage
‪modifyPage()
Definition: ActionTest.php:547
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changeContentSortingAndDeleteLiveRecord
‪changeContentSortingAndDeleteLiveRecord()
Definition: ActionTest.php:401
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageToDifferentPage
‪movePageToDifferentPage()
Definition: ActionTest.php:729
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPageAndMoveCreatedPage
‪createPageAndMoveCreatedPage()
Definition: ActionTest.php:682
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\moveContentToDifferentPage
‪moveContentToDifferentPage()
Definition: ActionTest.php:420
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizePageAndContentsAndDeletePageLocalization
‪localizePageAndContentsAndDeletePageLocalization()
Definition: ActionTest.php:595
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\moveContentToDifferentPageAndChangeSorting
‪moveContentToDifferentPageAndChangeSorting()
Definition: ActionTest.php:444
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\$assertCleanReferenceIndex
‪bool $assertCleanReferenceIndex
Definition: ActionTest.php:34
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\AbstractActionTestCase
Definition: AbstractActionTestCase.php:22
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentAfterMovedInLiveContent
‪localizeContentAfterMovedInLiveContent()
Definition: ActionTest.php:283