‪TYPO3CMS  11.5
ActionTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
22 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequestContext;
23 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
24 
29 {
33  public function ‪verifyCleanReferenceIndex(): void
34  {
35  // The test verifies the imported data set has a clean reference index by the check in tearDown()
36  self::assertTrue(true);
37  }
38 
42  public function ‪createContents(): void
43  {
44  parent::createContents();
45  $this->actionService->clearWorkspaceRecords(
46  [
47  self::TABLE_Content => [$this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']],
48  ]
49  );
50  $this->assertCSVDataSet(__DIR__ . '/DataSet/createContents.csv');
51  }
52 
56  public function ‪createContentAndCopyContent(): void
57  {
58  parent::createContentAndCopyContent();
59  // discard copied content
60  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['versionedCopiedContentId']);
61  $this->assertCSVDataSet(__DIR__ . '/DataSet/createContentAndCopyContent.csv');
62  }
63 
67  public function ‪createContentAndLocalize(): void
68  {
69  parent::createContentAndLocalize();
70  // discard default language content
71  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
72  $this->assertCSVDataSet(__DIR__ . '/DataSet/createContentAndLocalize.csv');
73  }
74 
78  public function ‪modifyContent(): void
79  {
80  parent::modifyContent();
81  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
82  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyContent.csv');
83  }
84 
88  public function ‪hideContent(): void
89  {
90  parent::hideContent();
91  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
92  $this->assertCSVDataSet(__DIR__ . '/DataSet/hideContent.csv');
93  }
94 
98  public function ‪hideContentAndMoveToDifferentPage(): void
99  {
100  parent::hideContent();
101  parent::moveContentToDifferentPage();
102  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
103  $this->assertCSVDataSet(__DIR__ . '/DataSet/hideContentAndMoveToDifferentPage.csv');
104  }
105 
109  public function ‪deleteContent(): void
110  {
111  parent::deleteContent();
112  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
113  $this->assertCSVDataSet(__DIR__ . '/DataSet/deleteContent.csv');
114  }
115 
120  {
121  // Create translated page first
122  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
123  parent::deleteLocalizedContentAndDeleteContent();
124  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdThird);
125  $this->assertCSVDataSet(__DIR__ . '/DataSet/deleteLocalizedContentNDeleteContent.csv');
126  }
127 
131  public function ‪copyContent(): void
132  {
133  parent::copyContent();
134  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['copiedContentId']);
135  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyContent.csv');
136  }
137 
141  public function ‪copyContentToLanguage(): void
142  {
143  // Create translated page first
144  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
145  parent::copyContentToLanguage();
146  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
147  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyContentToLanguage.csv');
148  }
149 
154  {
155  // Create translated page first
156  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
157  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
158  parent::copyContentToLanguageFromNonDefaultLanguage();
159  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
160  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyContentToLanguageFromNonDefaultLanguage.csv');
161  }
162 
166  public function ‪localizeContent(): void
167  {
168  // Create translated page first
169  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
170  parent::localizeContent();
171  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
172  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContent.csv');
173  }
174 
178  public function ‪localizeContentAfterMovedContent(): void
179  {
180  parent::localizeContentAfterMovedContent();
181  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
182  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentAfterMovedContent.csv');
183  }
184 
189  {
190  parent::localizeContentAfterMovedInLiveContent();
191  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
192  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentAfterMovedInLiveContent.csv');
193  }
194 
199  {
200  // Create translated page first
201  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
202  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
203  parent::localizeContentFromNonDefaultLanguage();
204  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
205  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentFromNonDefaultLanguage.csv');
206  }
207 
211  public function ‪changeContentSorting(): void
212  {
213  parent::changeContentSorting();
214  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
215  $this->assertCSVDataSet(__DIR__ . '/DataSet/changeContentSorting.csv');
216  }
217 
221  public function ‪changeContentSortingAfterSelf(): void
222  {
223  parent::changeContentSortingAfterSelf();
224  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
225  $this->assertCSVDataSet(__DIR__ . '/DataSet/changeContentSortingAfterSelf.csv');
226  }
227 
232  {
233  parent::changeContentSortingAndDeleteMovedRecord();
234  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
235  // Note the deleted=1 records are NOT discarded. This is ok since deleted=1 means "not seen in backend",
236  // so it is also ignored by the discard operation.
237  $this->assertCSVDataSet(__DIR__ . '/DataSet/changeContentSortingNDeleteMovedRecord.csv');
238  }
239 
244  {
245  parent::changeContentSortingAndDeleteLiveRecord();
246  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
247  // Note the deleted=1 records are NOT discarded. This is ok since deleted=1 means "not seen in backend",
248  // so it is also ignored by the discard operation.
249  $this->assertCSVDataSet(__DIR__ . '/DataSet/changeContentSortingNDeleteLiveRecord.csv');
250  }
251 
255  public function ‪moveContentToDifferentPage(): void
256  {
257  parent::moveContentToDifferentPage();
258  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
259  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveContentToDifferentPage.csv');
260  }
261 
266  {
267  parent::moveContentToDifferentPageAndChangeSorting();
268  $this->actionService->clearWorkspaceRecords([
269  self::TABLE_Content => [self::VALUE_ContentIdFirst, self::VALUE_ContentIdSecond],
270  ]);
271  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveContentToDifferentPageNChangeSorting.csv');
272  }
273 
277  public function ‪moveContentToDifferentPageAndHide(): void
278  {
279  parent::moveContentToDifferentPageAndHide();
280  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
281  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveContentToDifferentPageAndHide.csv');
282  }
283 
288  {
289  parent::moveLocalizedContentToDifferentPage();
290  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdThird);
291  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveLocalizedContentToDifferentPage.csv');
292 
293  // Check if the regular page contains the original record again
294  $response = $this->executeFrontendSubRequest(
295  (new InternalRequest())->withPageId(self::VALUE_PageId),
296  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
297  );
298  $responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
299  self::assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
300  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #3'));
301 
313  // Check if the target page does not contain the moved record
314  $response = $this->executeFrontendSubRequest(
315  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget),
316  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
317  );
318  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
319  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
320  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #3'));
321 
322  // Also test the translated page, and make sure the translated record is also discarded
323  $response = $this->executeFrontendSubRequest(
324  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget)->withLanguageId(self::VALUE_LanguageId),
325  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
326  );
327  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
328  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
329  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3'));
330  }
331 
339  public function ‪createPage(): void
340  {
341  parent::createPage();
342  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['newPageId']);
343  $this->assertCSVDataSet(__DIR__ . '/DataSet/createPage.csv');
344  }
345 
350  {
351  parent::createPageAndSubPageAndSubPageContent();
352  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['newPageId']);
353  $this->assertCSVDataSet(__DIR__ . '/DataSet/createPageAndSubPageAndSubPageContent.csv');
354  }
355 
359  public function ‪modifyPage(): void
360  {
361  parent::modifyPage();
362  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
363  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyPage.csv');
364  }
365 
369  public function ‪deletePage(): void
370  {
371  parent::deletePage();
372  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
373  $this->assertCSVDataSet(__DIR__ . '/DataSet/deletePage.csv');
374  }
375 
379  public function ‪deleteContentAndPage(): void
380  {
381  parent::deleteContentAndPage();
382  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
383  $this->assertCSVDataSet(__DIR__ . '/DataSet/deleteContentAndPage.csv');
384  }
385 
390  {
391  // Create localized page and localize content elements first
392  parent::localizePageAndContentsAndDeletePageLocalization();
393  // Deleted records are not discarded
394  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
395  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageAndContentsAndDeletePageLocalization.csv');
396  }
397 
401  public function ‪localizeNestedPagesAndContents(): void
402  {
403  parent::localizeNestedPagesAndContents();
404  // Should discard the localized parent page and its content elements, but no sub page change or default lang content element
405  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedParentPageId']);
406  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeNestedPagesAndContents.csv');
407  }
408 
412  public function ‪copyPage(): void
413  {
414  parent::copyPage();
415  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['newPageId']);
416  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyPage.csv');
417  }
418 
422  public function ‪copyPageFreeMode(): void
423  {
424  parent::copyPageFreeMode();
425  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['newPageId']);
426  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyPageFreeMode.csv');
427  }
428 
432  public function ‪localizePage(): void
433  {
434  parent::localizePage();
435  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
436  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePage.csv');
437  }
438 
442  public function ‪localizePageHiddenHideAtCopyFalse(): void
443  {
444  parent::localizePageHiddenHideAtCopyFalse();
445  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
446  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageHiddenHideAtCopyFalse.csv');
447  }
448 
453  {
454  parent::localizePageNotHiddenHideAtCopyFalse();
455  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
456  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageNotHiddenHideAtCopyFalse.csv');
457  }
458 
463  {
464  parent::localizePageNotHiddenHideAtCopyDisableHideAtCopyUnset();
465  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
466  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageNotHiddenHideAtCopyDisableHideAtCopyUnset.csv');
467  }
468 
473  {
474  parent::localizePageHiddenHideAtCopyDisableHideAtCopyUnset();
475  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
476  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageHiddenHideAtCopyDisableHideAtCopyUnset.csv');
477  }
478 
483  {
484  parent::localizePageNotHiddenHideAtCopyDisableHideAtCopySetToFalse();
485  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
486  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageNotHiddenHideAtCopyDisableHideAtCopySetToFalse.csv');
487  }
488 
493  {
494  parent::localizePageHiddenHideAtCopyDisableHideAtCopySetToFalse();
495  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
496  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageHiddenHideAtCopyDisableHideAtCopySetToFalse.csv');
497  }
498 
503  {
504  parent::localizePageNotHiddenHideAtCopyDisableHideAtCopySetToTrue();
505  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
506  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageNotHiddenHideAtCopyDisableHideAtCopySetToTrue.csv');
507  }
508 
513  {
514  parent::localizePageHiddenHideAtCopyDisableHideAtCopySetToTrue();
515  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
516  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageHiddenHideAtCopyDisableHideAtCopySetToTrue.csv');
517  }
518 
522  public function ‪createPageAndChangePageSorting(): void
523  {
524  parent::createPageAndChangePageSorting();
525  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['newPageId']);
526  $this->assertCSVDataSet(__DIR__ . '/DataSet/createPageAndChangePageSorting.csv');
527  }
528 
532  public function ‪createPageAndMoveCreatedPage(): void
533  {
534  parent::createPageAndMoveCreatedPage();
535  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['newPageId']);
536  $this->assertCSVDataSet(__DIR__ . '/DataSet/createPageAndMoveCreatedPage.csv');
537  }
538 
542  public function ‪changePageSorting(): void
543  {
544  parent::changePageSorting();
545  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
546  $this->assertCSVDataSet(__DIR__ . '/DataSet/changePageSorting.csv');
547  }
548 
552  public function ‪changePageSortingAfterSelf(): void
553  {
554  parent::changePageSortingAfterSelf();
555  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
556  $this->assertCSVDataSet(__DIR__ . '/DataSet/changePageSortingAfterSelf.csv');
557  }
558 
562  public function ‪movePageToDifferentPage(): void
563  {
564  parent::movePageToDifferentPage();
565  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
566  $this->assertCSVDataSet(__DIR__ . '/DataSet/movePageToDifferentPage.csv');
567  }
568 
572  public function ‪movePageToDifferentPageTwice(): void
573  {
574  parent::movePageToDifferentPageTwice();
575  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
576  $this->assertCSVDataSet(__DIR__ . '/DataSet/movePageToDifferentPageTwice.csv');
577  }
578 
583  {
584  parent::movePageLocalizedToDifferentPageTwice();
585  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
586  $this->assertCSVDataSet(__DIR__ . '/DataSet/movePageLocalizedToDifferentPageTwice.csv');
587  }
588 
593  {
594  parent::movePageLocalizedInLiveToDifferentPageTwice();
595  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
596  $this->assertCSVDataSet(__DIR__ . '/DataSet/movePageLocalizedInLiveToDifferentPageTwice.csv');
597  }
598 
603  {
604  parent::movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice();
605  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
606  $this->assertCSVDataSet(__DIR__ . '/DataSet/movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice.csv');
607  }
608 
613  {
614  parent::movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice();
615  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
616  $this->assertCSVDataSet(__DIR__ . '/DataSet/movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice.csv');
617  }
618 
623  {
624  parent::movePageToDifferentPageAndChangeSorting();
625  $this->actionService->clearWorkspaceRecords([
626  self::TABLE_Page => [self::VALUE_PageId, self::VALUE_PageIdTarget],
627  ]);
628  $this->assertCSVDataSet(__DIR__ . '/DataSet/movePageToDifferentPageNChangeSorting.csv');
629  }
630 
637  {
638  parent::movePageToDifferentPageAndCreatePageAfterMovedPage();
639  $this->actionService->clearWorkspaceRecords([
640  self::TABLE_Page => [self::VALUE_PageIdTarget, $this->recordIds['newPageId']],
641  ]);
642  $this->assertCSVDataSet(__DIR__ . '/DataSet/movePageToDifferentPageNCreatePageAfterMovedPage.csv');
643  }
644 
645  /*************************************
646  * Copying page contents and sub-pages
647  *************************************/
648 
652  public function ‪createContentAndCopyDraftPage(): void
653  {
654  parent::createContentAndCopyDraftPage();
655  $this->actionService->clearWorkspaceRecords([
656  self::TABLE_Content => [$this->recordIds['newContentId']],
657  self::TABLE_Page => [$this->recordIds['copiedPageId']],
658  ]);
659  $this->assertCSVDataSet(__DIR__ . '/DataSet/createContentAndCopyDraftPage.csv');
660  }
661 
665  public function ‪createPageAndCopyDraftParentPage(): void
666  {
667  parent::createPageAndCopyDraftParentPage();
668  $this->actionService->clearWorkspaceRecords([
669  self::TABLE_Page => [$this->recordIds['newPageId'], $this->recordIds['copiedPageId']],
670  ]);
671  $this->assertCSVDataSet(__DIR__ . '/DataSet/createPageAndCopyDraftParentPage.csv');
672  }
673 
678  {
679  parent::createNestedPagesAndCopyDraftParentPage();
680  // Discarding only the copied parent page to see what happens with sub pages
681  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['copiedPageId']);
682  $this->assertCSVDataSet(__DIR__ . '/DataSet/createNestedPagesAndCopyDraftParentPage.csv');
683  }
684 
689  {
690  parent::createPlaceholdersAndDeleteDraftParentPage();
691  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, $this->recordIds['deletedPageId']);
692  $this->assertCSVDataSet(__DIR__ . '/DataSet/createPlaceholdersAndDeleteDraftParentPage.csv');
693  }
694 
701  {
702  // Switch to live workspace and localize page in live
703  $this->‪setWorkspaceId(0);
704  $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
705  $this->‪setWorkspaceId(self::VALUE_WorkspaceId);
706 
707  // Localize 'Regular Element #2' (289) in workspace "connected mode"
708  $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
709 
710  // And now *delete* the default language content element 'Regular Element #2' (289) in *live*,
711  // which should *discard* the above localized content element in workspaces again.
712  $this->‪setWorkspaceId(0);
713  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
714  $this->‪setWorkspaceId(self::VALUE_WorkspaceId);
715 
716  $this->assertCSVDataSet(__DIR__ . '/DataSet/deletingDefaultLanguageElementDiscardsConnectedLocalizedElement.csv');
717  }
718 
728  {
729  // Switch to live workspace and localize page in live
730  $this->‪setWorkspaceId(0);
731  $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
732  $this->‪setWorkspaceId(self::VALUE_WorkspaceId);
733 
734  // Localize 'Regular Element #2' (289) in workspace "connected mode"
735  $newRecordIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdSecond, self::VALUE_LanguageId);
736  $localizedRecordId = $newRecordIds['tt_content'][‪self::VALUE_ContentIdSecond];
737  // Localize 'Regular Element #2' (289) in workspace "connected mode" to language 2 as 'translation of translation':
738  // l10n_parent still points to 289, but l10n_source points to 321.
739  $this->actionService->localizeRecord(self::TABLE_Content, $localizedRecordId, self::VALUE_LanguageIdSecond);
740 
741  // And now *delete* the default language content element 'Regular Element #2' (289) in *live*,
742  // which should *discard* the above localized content elements in workspaces again.
743  $this->‪setWorkspaceId(0);
744  $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
745  $this->‪setWorkspaceId(self::VALUE_WorkspaceId);
746 
747  $this->assertCSVDataSet(__DIR__ . '/DataSet/deletingDefaultLanguageElementDiscardsConnectedLocalizedElementChain.csv');
748  }
749 }
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\movePageLocalizedToDifferentPageTwice
‪movePageLocalizedToDifferentPageTwice()
Definition: ActionTest.php:582
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\modifyPage
‪modifyPage()
Definition: ActionTest.php:359
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\moveLocalizedContentToDifferentPage
‪moveLocalizedContentToDifferentPage()
Definition: ActionTest.php:287
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\movePageToDifferentPage
‪movePageToDifferentPage()
Definition: ActionTest.php:562
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionHasRecordConstraint
‪HasRecordConstraint getRequestSectionHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:245
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createPageAndSubPageAndSubPageContent
‪createPageAndSubPageAndSubPageContent()
Definition: ActionTest.php:349
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createPageAndChangePageSorting
‪createPageAndChangePageSorting()
Definition: ActionTest.php:522
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createContentAndCopyContent
‪createContentAndCopyContent()
Definition: ActionTest.php:56
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizeNestedPagesAndContents
‪localizeNestedPagesAndContents()
Definition: ActionTest.php:401
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createPageAndMoveCreatedPage
‪createPageAndMoveCreatedPage()
Definition: ActionTest.php:532
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\verifyCleanReferenceIndex
‪verifyCleanReferenceIndex()
Definition: ActionTest.php:33
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePageAndContentsAndDeletePageLocalization
‪localizePageAndContentsAndDeletePageLocalization()
Definition: ActionTest.php:389
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePageHiddenHideAtCopyDisableHideAtCopySetToTrue
‪localizePageHiddenHideAtCopyDisableHideAtCopySetToTrue()
Definition: ActionTest.php:512
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePageHiddenHideAtCopyFalse
‪localizePageHiddenHideAtCopyFalse()
Definition: ActionTest.php:442
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\moveContentToDifferentPageAndHide
‪moveContentToDifferentPageAndHide()
Definition: ActionTest.php:277
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\changeContentSorting
‪changeContentSorting()
Definition: ActionTest.php:211
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createNestedPagesAndCopyDraftParentPage
‪createNestedPagesAndCopyDraftParentPage()
Definition: ActionTest.php:677
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\deletePage
‪deletePage()
Definition: ActionTest.php:369
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\hideContent
‪hideContent()
Definition: ActionTest.php:88
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createPage
‪createPage()
Definition: ActionTest.php:339
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\movePageToDifferentPageAndCreatePageAfterMovedPage
‪movePageToDifferentPageAndCreatePageAfterMovedPage()
Definition: ActionTest.php:636
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createContentAndLocalize
‪createContentAndLocalize()
Definition: ActionTest.php:67
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\copyPageFreeMode
‪copyPageFreeMode()
Definition: ActionTest.php:422
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createContents
‪createContents()
Definition: ActionTest.php:42
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase\VALUE_ContentIdSecond
‪const VALUE_ContentIdSecond
Definition: AbstractActionTestCase.php:38
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createPageAndCopyDraftParentPage
‪createPageAndCopyDraftParentPage()
Definition: ActionTest.php:665
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createContentAndCopyDraftPage
‪createContentAndCopyDraftPage()
Definition: ActionTest.php:652
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePageHiddenHideAtCopyDisableHideAtCopySetToFalse
‪localizePageHiddenHideAtCopyDisableHideAtCopySetToFalse()
Definition: ActionTest.php:492
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\changePageSorting
‪changePageSorting()
Definition: ActionTest.php:542
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest
Definition: ActionTest.php:29
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\movePageLocalizedInLiveToDifferentPageTwice
‪movePageLocalizedInLiveToDifferentPageTwice()
Definition: ActionTest.php:592
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizeContentAfterMovedInLiveContent
‪localizeContentAfterMovedInLiveContent()
Definition: ActionTest.php:188
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setWorkspaceId
‪setWorkspaceId(int $workspaceId)
Definition: AbstractDataHandlerActionTestCase.php:166
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\changePageSortingAfterSelf
‪changePageSortingAfterSelf()
Definition: ActionTest.php:552
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePageNotHiddenHideAtCopyDisableHideAtCopySetToTrue
‪localizePageNotHiddenHideAtCopyDisableHideAtCopySetToTrue()
Definition: ActionTest.php:502
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\deletingDefaultLanguageElementDiscardsConnectedLocalizedElementChain
‪deletingDefaultLanguageElementDiscardsConnectedLocalizedElementChain()
Definition: ActionTest.php:727
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePage
‪localizePage()
Definition: ActionTest.php:432
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePageNotHiddenHideAtCopyDisableHideAtCopySetToFalse
‪localizePageNotHiddenHideAtCopyDisableHideAtCopySetToFalse()
Definition: ActionTest.php:482
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionDoesNotHaveRecordConstraint
‪DoesNotHaveRecordConstraint getRequestSectionDoesNotHaveRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:253
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\copyContent
‪copyContent()
Definition: ActionTest.php:131
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePageNotHiddenHideAtCopyDisableHideAtCopyUnset
‪localizePageNotHiddenHideAtCopyDisableHideAtCopyUnset()
Definition: ActionTest.php:462
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizeContentAfterMovedContent
‪localizeContentAfterMovedContent()
Definition: ActionTest.php:178
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\movePageToDifferentPageAndChangeSorting
‪movePageToDifferentPageAndChangeSorting()
Definition: ActionTest.php:622
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\movePageToDifferentPageTwice
‪movePageToDifferentPageTwice()
Definition: ActionTest.php:572
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice
‪movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice()
Definition: ActionTest.php:612
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\changeContentSortingAfterSelf
‪changeContentSortingAfterSelf()
Definition: ActionTest.php:221
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\copyContentToLanguageFromNonDefaultLanguage
‪copyContentToLanguageFromNonDefaultLanguage()
Definition: ActionTest.php:153
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\changeContentSortingAndDeleteMovedRecord
‪changeContentSortingAndDeleteMovedRecord()
Definition: ActionTest.php:231
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice
‪movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice()
Definition: ActionTest.php:602
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePageNotHiddenHideAtCopyFalse
‪localizePageNotHiddenHideAtCopyFalse()
Definition: ActionTest.php:452
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizePageHiddenHideAtCopyDisableHideAtCopyUnset
‪localizePageHiddenHideAtCopyDisableHideAtCopyUnset()
Definition: ActionTest.php:472
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard
Definition: ActionTest.php:18
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\hideContentAndMoveToDifferentPage
‪hideContentAndMoveToDifferentPage()
Definition: ActionTest.php:98
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\modifyContent
‪modifyContent()
Definition: ActionTest.php:78
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\deletingDefaultLanguageElementDiscardsConnectedLocalizedElement
‪deletingDefaultLanguageElementDiscardsConnectedLocalizedElement()
Definition: ActionTest.php:700
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\createPlaceholdersAndDeleteDraftParentPage
‪createPlaceholdersAndDeleteDraftParentPage()
Definition: ActionTest.php:688
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\moveContentToDifferentPage
‪moveContentToDifferentPage()
Definition: ActionTest.php:255
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\deleteContentAndPage
‪deleteContentAndPage()
Definition: ActionTest.php:379
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\deleteContent
‪deleteContent()
Definition: ActionTest.php:109
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\copyPage
‪copyPage()
Definition: ActionTest.php:412
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizeContentFromNonDefaultLanguage
‪localizeContentFromNonDefaultLanguage()
Definition: ActionTest.php:198
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\moveContentToDifferentPageAndChangeSorting
‪moveContentToDifferentPageAndChangeSorting()
Definition: ActionTest.php:265
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\deleteLocalizedContentAndDeleteContent
‪deleteLocalizedContentAndDeleteContent()
Definition: ActionTest.php:119
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\changeContentSortingAndDeleteLiveRecord
‪changeContentSortingAndDeleteLiveRecord()
Definition: ActionTest.php:243
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\AbstractActionTestCase
Definition: AbstractActionTestCase.php:24
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\copyContentToLanguage
‪copyContentToLanguage()
Definition: ActionTest.php:141
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Discard\ActionTest\localizeContent
‪localizeContent()
Definition: ActionTest.php:166