‪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/PublishAll/DataSet/';
32 
36  protected ‪$assertCleanReferenceIndex = false;
37 
42  public function ‪createContents()
43  {
44  parent::createContents();
45  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
46  $this->‪assertAssertionDataSet('createContents');
47 
48  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
49  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
50  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
51  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', 'Testing #2'));
52  }
53 
57  public function ‪createContentAndCopyContent()
58  {
59  parent::createContentAndCopyContent();
60  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
61  $this->‪assertAssertionDataSet('createContentAndCopyContent');
62 
63  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
64  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
65  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
66  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', 'Testing #1 (copy 1)'));
67  }
68 
73  public function ‪modifyContent()
74  {
75  parent::modifyContent();
76  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
77  $this->‪assertAssertionDataSet('modifyContent');
78 
79  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
80  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
81  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
82  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
83  }
84 
88  public function ‪hideContent()
89  {
90  parent::hideContent();
91  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
92  $this->‪assertAssertionDataSet('hideContent');
93 
94  $response = $this->executeFrontendRequest(
95  (new InternalRequest())->withPageId(self::VALUE_PageId),
96  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)
97  );
98  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
99  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
100  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
101  }
102 
106  public function ‪hideContentAndMoveToDifferentPage()
107  {
108  parent::hideContent();
109  parent::moveContentToDifferentPage();
110  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
111  $this->‪assertAssertionDataSet('hideContentAndMoveToDifferentPage');
112 
113  $response = $this->executeFrontendRequest(
114  (new InternalRequest())->withPageId(self::VALUE_PageId),
115  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)
116  );
117  $responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
118  self::assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
119  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
120  self::assertThat($responseSectionsSource, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
121  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
122  $response = $this->executeFrontendRequest(
123  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget),
124  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)
125  );
126  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
127  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionHasRecordConstraint()
128  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
129  }
130 
134  public function ‪deleteContent()
135  {
136  parent::deleteContent();
137  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
138  $this->‪assertAssertionDataSet('deleteContent');
139 
140  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
141  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
142  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
143  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
144  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
145  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
146  }
147 
152  {
153  // Create translated page first
154  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
155  parent::deleteLocalizedContentAndDeleteContent();
156  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
157  $this->‪assertAssertionDataSet('deleteLocalizedContentNDeleteContent');
158 
159  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
160  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
161  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
162  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #3', '[Translate to Dansk:] Regular Element #3', 'Regular Element #1'));
163  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
164  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', 'Regular Element #2'));
165  }
166 
170  public function ‪copyContent()
171  {
172  parent::copyContent();
173  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
174  $this->‪assertAssertionDataSet('copyContent');
175 
176  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
177  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
178  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
179  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2 (copy 1)'));
180  }
181 
185  public function ‪copyContentToLanguage()
186  {
187  // Create translated page first
188  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
189  parent::copyContentToLanguage();
190  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
191  $this->‪assertAssertionDataSet('copyContentToLanguage');
192 
193  // Set up "dk" to not have overlays
194  $languageConfiguration = ‪$this->siteLanguageConfiguration;
195  $languageConfiguration[‪self::VALUE_LanguageId]['fallbackType'] = 'free';
196  $this->‪setUpFrontendSite(1, $languageConfiguration);
197  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
198  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
199  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
200  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2'));
201  }
202 
207  {
208  // Create translated page first
209  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
210  parent::copyContentToLanguageFromNonDefaultLanguage();
211  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
212  $this->‪assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage');
213 
214  // Set up "de" to not have overlays
215  $languageConfiguration = ‪$this->siteLanguageConfiguration;
216  $languageConfiguration[‪self::VALUE_LanguageIdSecond]['fallbackType'] = 'free';
217  $this->‪setUpFrontendSite(1, $languageConfiguration);
218  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
219  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
220  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
221  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
222  }
223 
227  public function ‪localizeContent()
228  {
229  // Create translated page first
230  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
231  parent::localizeContent();
232  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
233  $this->‪assertAssertionDataSet('localizeContent');
234 
235  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
236  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
237  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
238  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
239  }
240 
244  public function ‪localizeContentAfterMovedContent()
245  {
246  parent::localizeContentAfterMovedContent();
247  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
248  $this->‪assertAssertionDataSet('localizeContentAfterMovedContent');
249  }
250 
255  {
256  parent::localizeContentAfterMovedInLiveContent();
257  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
258  $this->‪assertAssertionDataSet('localizeContentAfterMovedInLiveContent');
259  }
260 
265  {
266  // Create translated page first
267  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
268  parent::localizeContentFromNonDefaultLanguage();
269  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
270  $this->‪assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
271 
272  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
273  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
274  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
275  ->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'));
276  }
277 
281  public function ‪changeContentSorting()
282  {
283  parent::changeContentSorting();
284  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
285  $this->‪assertAssertionDataSet('changeContentSorting');
286 
287  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
288  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
289  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
290  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
291  }
292 
296  public function ‪changeContentSortingAfterSelf()
297  {
298  parent::changeContentSortingAfterSelf();
299  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
300  $this->‪assertAssertionDataSet('changeContentSortingAfterSelf');
301 
302  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
303  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
304  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
305  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
306  }
307 
311  public function ‪moveContentToDifferentPage()
312  {
313  parent::moveContentToDifferentPage();
314  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
315  $this->‪assertAssertionDataSet('moveContentToDifferentPage');
316 
317  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
318  $responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
319  self::assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
320  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
321  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
322  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
323  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionHasRecordConstraint()
324  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
325  }
326 
331  {
332  parent::moveContentToDifferentPageAndChangeSorting();
333  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
334  $this->‪assertAssertionDataSet('moveContentToDifferentPageNChangeSorting');
335 
336  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
337  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
338  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
339  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
340  }
341 
345  public function ‪moveContentToDifferentPageAndHide()
346  {
347  parent::moveContentToDifferentPageAndHide();
348  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
349  $this->‪assertAssertionDataSet('moveContentToDifferentPageAndHide');
350 
351  $response = $this->executeFrontendRequest(
352  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget),
353  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
354  );
355  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
356  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
357  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
358  }
359 
367  public function ‪createPage()
368  {
369  parent::createPage();
370  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
371  $this->‪assertAssertionDataSet('createPage');
372 
373  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
374  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
375  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
376  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
377  }
378 
383  {
384  parent::createPageAndSubPageAndSubPageContent();
385  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
386  $this->‪assertAssertionDataSet('createPageAndSubPageAndSubPageContent');
387 
388  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newSubPageId']));
389  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
390  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
391  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1 #1'));
392  }
393 
397  public function ‪modifyPage()
398  {
399  parent::modifyPage();
400  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
401  $this->‪assertAssertionDataSet('modifyPage');
402 
403  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
404  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
405  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
406  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
407  }
408 
412  public function ‪deletePage()
413  {
414  parent::deletePage();
415  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
416  $this->‪assertAssertionDataSet('deletePage');
417 
418  $response = $this->executeFrontendRequest(
419  (new InternalRequest())->withPageId(self::VALUE_PageId)
420  );
421  self::assertEquals(404, $response->getStatusCode());
422  }
423 
427  public function ‪deleteContentAndPage()
428  {
429  parent::deleteContentAndPage();
430  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
431  $this->‪assertAssertionDataSet('deleteContentAndPage');
432 
433  $response = $this->executeFrontendRequest(
434  (new InternalRequest())->withPageId(self::VALUE_PageId)
435  );
436  self::assertEquals(404, $response->getStatusCode());
437  }
438 
443  {
444  // Create localized page and localize content elements first
445  parent::localizePageAndContentsAndDeletePageLocalization();
446  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
447  $this->‪assertAssertionDataSet('localizePageAndContentsAndDeletePageLocalization');
448 
449  $response = $this->executeFrontendRequest(
450  (new InternalRequest())->withPageId($this->recordIds['localizedPageId']),
451  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
452  );
453  self::assertEquals(404, $response->getStatusCode());
454  }
455 
459  public function ‪localizeNestedPagesAndContents()
460  {
461  parent::localizeNestedPagesAndContents();
462  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
463  $this->‪assertAssertionDataSet('localizeNestedPagesAndContents');
464  }
465 
469  public function ‪copyPage()
470  {
471  parent::copyPage();
472  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
473  $this->‪assertAssertionDataSet('copyPage');
474 
475  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
476  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
477  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
478  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
479  }
480 
484  public function ‪copyPageFreeMode()
485  {
486  parent::copyPageFreeMode();
487  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
488  $this->‪assertAssertionDataSet('copyPageFreeMode');
489 
490  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
491  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
492  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
493  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target'));
494  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
495  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #10'));
496  }
497 
501  public function ‪localizePage()
502  {
503  parent::localizePage();
504  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
505  $this->‪assertAssertionDataSet('localizePage');
506 
507  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
508  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
509  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
510  ->setTable(self::TABLE_Page)->setField('title')->setValues('[Translate to Dansk:] Relations'));
511  }
512 
518  public function ‪createPageAndChangePageSorting()
519  {
520  parent::createPageAndChangePageSorting();
521  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
522  $this->‪assertAssertionDataSet('createPageAndChangePageSorting');
523  }
524 
529  public function ‪createPageAndMoveCreatedPage()
530  {
531  parent::createPageAndMoveCreatedPage();
532  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
533  $this->‪assertAssertionDataSet('createPageAndMoveCreatedPage');
534  }
535 
539  public function ‪changePageSorting()
540  {
541  parent::changePageSorting();
542  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
543  $this->‪assertAssertionDataSet('changePageSorting');
544 
545  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
546  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
547  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
548  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
549  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
550  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
551  }
552 
556  public function ‪changePageSortingAfterSelf()
557  {
558  parent::changePageSortingAfterSelf();
559  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
560  $this->‪assertAssertionDataSet('changePageSortingAfterSelf');
561 
562  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
563  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
564  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
565  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
566  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
567  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
568  }
569 
573  public function ‪movePageToDifferentPage()
574  {
575  parent::movePageToDifferentPage();
576  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
577  $this->‪assertAssertionDataSet('movePageToDifferentPage');
578 
579  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
580  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
581  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
582  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
583  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
584  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
585  }
586 
590  public function ‪movePageToDifferentPageTwice()
591  {
592  parent::movePageToDifferentPageTwice();
593  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
594  $this->‪assertAssertionDataSet('movePageToDifferentPageTwice');
595  }
596 
601  {
602  parent::movePageLocalizedToDifferentPageTwice();
603  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
604  $this->‪assertAssertionDataSet('movePageLocalizedToDifferentPageTwice');
605  }
606 
611  {
612  parent::movePageLocalizedInLiveToDifferentPageTwice();
613  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
614  $this->‪assertAssertionDataSet('movePageLocalizedInLiveToDifferentPageTwice');
615  }
616 
621  {
622  parent::movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice();
623  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
624  $this->‪assertAssertionDataSet('movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice');
625  }
626 
631  {
632  parent::movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice();
633  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
634  $this->‪assertAssertionDataSet('movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice');
635  }
636 
641  {
642  parent::movePageToDifferentPageAndChangeSorting();
643  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
644  $this->‪assertAssertionDataSet('movePageToDifferentPageNChangeSorting');
645 
646  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
647  $responseSectionsPage = ResponseContent::fromString((string)$response->getBody())->getSections();
648  self::assertThat($responseSectionsPage, $this->‪getRequestSectionHasRecordConstraint()
649  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
650  self::assertThat($responseSectionsPage, $this->‪getRequestSectionHasRecordConstraint()
651  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
652  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdWebsite));
653  $responseSectionsWebsite = ResponseContent::fromString((string)$response->getBody())->getSections();
654  self::assertThat($responseSectionsWebsite, $this->‪getRequestSectionStructureHasRecordConstraint()
655  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
656  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Relations', 'DataHandlerTest'));
657  }
658 
665  {
666  parent::movePageToDifferentPageAndCreatePageAfterMovedPage();
667  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
668  $this->‪assertAssertionDataSet('movePageToDifferentPageNCreatePageAfterMovedPage');
669 
670  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdWebsite));
671  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
672  self::assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
673  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
674  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Testing #1', 'DataHandlerTest'));
675  }
676 
680  public function ‪createContentAndCopyDraftPage()
681  {
682  parent::createContentAndCopyDraftPage();
683  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
684  $this->‪assertAssertionDataSet('createContentAndCopyDraftPage');
685 
686  $response = $this->executeFrontendRequest(
687  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
688  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
689  );
690  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
691  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
692  ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
693  }
694 
698  public function ‪createPageAndCopyDraftParentPage()
699  {
700  parent::createPageAndCopyDraftParentPage();
701  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
702  $this->‪assertAssertionDataSet('createPageAndCopyDraftParentPage');
703  }
704 
709  {
710  parent::createNestedPagesAndCopyDraftParentPage();
711  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
712  $this->‪assertAssertionDataSet('createNestedPagesAndCopyDraftParentPage');
713  }
714 
718  public function ‪createContentAndLocalize()
719  {
720  parent::createContentAndLocalize();
721  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
722  $this->‪assertAssertionDataSet('createContentAndLocalize');
723 
724  $response = $this->executeFrontendRequest(
725  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
726  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
727  );
728  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
729  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
730  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
731  }
732 
737  {
738  parent::changeContentSortingAndCopyDraftPage();
739  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
740  $this->‪assertAssertionDataSet('changeContentSortingAndCopyDraftPage');
741  }
742 
747  {
748  parent::createPlaceholdersAndDeleteDraftParentPage();
749  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
750  $this->‪assertAssertionDataSet('createPlaceholdersAndDeleteDraftParentPage');
751  }
752 
757  {
758  parent::createPlaceholdersAndDeleteLiveParentPage();
759  $this->actionService->publishWorkspace(self::VALUE_WorkspaceId);
760  $this->‪assertAssertionDataSet('createPlaceholdersAndDeleteLiveParentPage');
761  }
762 }
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\deleteContent
‪deleteContent()
Definition: ActionTest.php:132
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice
‪movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice()
Definition: ActionTest.php:618
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\$assertionDataSetDirectory
‪string $assertionDataSetDirectory
Definition: ActionTest.php:30
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\copyContentToLanguage
‪copyContentToLanguage()
Definition: ActionTest.php:183
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\deleteContentAndPage
‪deleteContentAndPage()
Definition: ActionTest.php:425
‪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\PublishAll\ActionTest\localizePageAndContentsAndDeletePageLocalization
‪localizePageAndContentsAndDeletePageLocalization()
Definition: ActionTest.php:440
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createContentAndCopyContent
‪createContentAndCopyContent()
Definition: ActionTest.php:55
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createContentAndCopyDraftPage
‪createContentAndCopyDraftPage()
Definition: ActionTest.php:678
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionStructureHasRecordConstraint
‪StructureHasRecordConstraint getRequestSectionStructureHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:305
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createContentAndLocalize
‪createContentAndLocalize()
Definition: ActionTest.php:716
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\copyPageFreeMode
‪copyPageFreeMode()
Definition: ActionTest.php:482
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\movePageLocalizedInLiveToDifferentPageTwice
‪movePageLocalizedInLiveToDifferentPageTwice()
Definition: ActionTest.php:608
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase\VALUE_LanguageId
‪const VALUE_LanguageId
Definition: AbstractActionTestCase.php:39
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\localizePage
‪localizePage()
Definition: ActionTest.php:499
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\localizeContentAfterMovedContent
‪localizeContentAfterMovedContent()
Definition: ActionTest.php:242
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createPageAndChangePageSorting
‪createPageAndChangePageSorting()
Definition: ActionTest.php:516
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\copyPage
‪copyPage()
Definition: ActionTest.php:467
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\copyContentToLanguageFromNonDefaultLanguage
‪copyContentToLanguageFromNonDefaultLanguage()
Definition: ActionTest.php:204
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\localizeContent
‪localizeContent()
Definition: ActionTest.php:225
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\changeContentSorting
‪changeContentSorting()
Definition: ActionTest.php:279
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice
‪movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice()
Definition: ActionTest.php:628
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase\VALUE_LanguageIdSecond
‪const VALUE_LanguageIdSecond
Definition: AbstractActionTestCase.php:40
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\$assertCleanReferenceIndex
‪bool $assertCleanReferenceIndex
Definition: ActionTest.php:34
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\localizeNestedPagesAndContents
‪localizeNestedPagesAndContents()
Definition: ActionTest.php:457
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createContents
‪createContents()
Definition: ActionTest.php:40
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createPlaceholdersAndDeleteLiveParentPage
‪createPlaceholdersAndDeleteLiveParentPage()
Definition: ActionTest.php:754
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\copyContent
‪copyContent()
Definition: ActionTest.php:168
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createNestedPagesAndCopyDraftParentPage
‪createNestedPagesAndCopyDraftParentPage()
Definition: ActionTest.php:706
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\movePageToDifferentPageTwice
‪movePageToDifferentPageTwice()
Definition: ActionTest.php:588
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\localizeContentAfterMovedInLiveContent
‪localizeContentAfterMovedInLiveContent()
Definition: ActionTest.php:252
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest
Definition: ActionTest.php:27
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createPage
‪createPage()
Definition: ActionTest.php:365
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\deletePage
‪deletePage()
Definition: ActionTest.php:410
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\movePageToDifferentPage
‪movePageToDifferentPage()
Definition: ActionTest.php:571
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll
Definition: ActionTest.php:16
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\hideContent
‪hideContent()
Definition: ActionTest.php:86
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\assertAssertionDataSet
‪assertAssertionDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:208
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionDoesNotHaveRecordConstraint
‪DoesNotHaveRecordConstraint getRequestSectionDoesNotHaveRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:297
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\moveContentToDifferentPageAndHide
‪moveContentToDifferentPageAndHide()
Definition: ActionTest.php:343
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\changePageSortingAfterSelf
‪changePageSortingAfterSelf()
Definition: ActionTest.php:554
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\hideContentAndMoveToDifferentPage
‪hideContentAndMoveToDifferentPage()
Definition: ActionTest.php:104
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\deleteLocalizedContentAndDeleteContent
‪deleteLocalizedContentAndDeleteContent()
Definition: ActionTest.php:149
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\movePageToDifferentPageAndChangeSorting
‪movePageToDifferentPageAndChangeSorting()
Definition: ActionTest.php:638
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createPageAndMoveCreatedPage
‪createPageAndMoveCreatedPage()
Definition: ActionTest.php:527
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\changeContentSortingAfterSelf
‪changeContentSortingAfterSelf()
Definition: ActionTest.php:294
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\$siteLanguageConfiguration
‪array $siteLanguageConfiguration
Definition: AbstractDataHandlerActionTestCase.php:86
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\changePageSorting
‪changePageSorting()
Definition: ActionTest.php:537
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\modifyPage
‪modifyPage()
Definition: ActionTest.php:395
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createPageAndCopyDraftParentPage
‪createPageAndCopyDraftParentPage()
Definition: ActionTest.php:696
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\localizeContentFromNonDefaultLanguage
‪localizeContentFromNonDefaultLanguage()
Definition: ActionTest.php:262
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\modifyContent
‪modifyContent()
Definition: ActionTest.php:71
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\moveContentToDifferentPageAndChangeSorting
‪moveContentToDifferentPageAndChangeSorting()
Definition: ActionTest.php:328
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\moveContentToDifferentPage
‪moveContentToDifferentPage()
Definition: ActionTest.php:309
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\movePageToDifferentPageAndCreatePageAfterMovedPage
‪movePageToDifferentPageAndCreatePageAfterMovedPage()
Definition: ActionTest.php:662
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\changeContentSortingAndCopyDraftPage
‪changeContentSortingAndCopyDraftPage()
Definition: ActionTest.php:734
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\movePageLocalizedToDifferentPageTwice
‪movePageLocalizedToDifferentPageTwice()
Definition: ActionTest.php:598
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createPlaceholdersAndDeleteDraftParentPage
‪createPlaceholdersAndDeleteDraftParentPage()
Definition: ActionTest.php:744
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\AbstractActionTestCase
Definition: AbstractActionTestCase.php:22
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\PublishAll\ActionTest\createPageAndSubPageAndSubPageContent
‪createPageAndSubPageAndSubPageContent()
Definition: ActionTest.php:380