diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php index 35bd6a691d3046c3351dabda38ee063062c7d6dd..06771b9dfefb15091b75bebd40fd20c700f9b7dc 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php @@ -60,6 +60,17 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->recordIds['versionedCopiedContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds['copiedContentId']); } + public function createContentAndLocalize() + { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, ['header' => 'Testing #1']); + $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0]; + $localizedContentId = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId); + $this->recordIds['localizedContentId'] = $localizedContentId[self::TABLE_Content][$this->recordIds['newContentId']]; + $this->recordIds['versionedCopiedContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds['copiedContentId']); + } + public function changeContentSortingAndDeleteMovedRecord() { $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdFirst, -self::VALUE_ContentIdSecond); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Discard/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Discard/ActionTest.php index b5f747181de4bfa0c1db8a8dae39216b3e433b8d..3defa7f32c518604810e0fff4e913cf94a80b121 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Discard/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Discard/ActionTest.php @@ -56,6 +56,17 @@ class ActionTest extends AbstractActionTestCase $this->assertAssertionDataSet('createContentAndCopyContent'); } + /** + * @test + */ + public function createContentAndLocalize() + { + parent::createContentAndLocalize(); + // discard default language content + $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']); + $this->assertAssertionDataSet('createContentAndLocalize'); + } + /** * @test */ diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Discard/DataSet/createContentAndLocalize.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Discard/DataSet/createContentAndLocalize.csv new file mode 100644 index 0000000000000000000000000000000000000000..4073d1e06f4864c6d468e2ad4a51dcf2c3084bd1 --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Discard/DataSet/createContentAndLocalize.csv @@ -0,0 +1,20 @@ +"tt_content",,,,,,,,,,,,,,, +,"uid","pid","sorting","deleted","hidden","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header" +,296,88,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #0" +,297,89,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #1" +,298,89,512,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #2" +,299,89,768,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #3" +,300,89,1024,0,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3" +,301,89,384,0,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1" +,302,89,448,0,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1" +,310,90,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #10" +,311,90,512,0,0,1,0,310,310,0,0,0,0,0,"[Translate to Dansk:] Regular Element #10" +,312,90,768,0,0,2,0,311,311,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10" +,320,89,512,0,0,0,0,0,298,2,2,0,298,0,"Regular Element #2" +"sys_refindex",,,,,,,,,,,,,,, +,"hash","tablename","recuid","field","sorting","deleted","workspace","ref_table","ref_uid",,,,,, +,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",0,0,0,"sys_workspace_stage",1,,,,,, +,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",0,0,0,"be_users",3,,,,,, +,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",0,0,0,"sys_category",28,,,,,, +,"620500aee65485a0aed7d1ee2d0eff17","pages",92,"l10n_parent",0,0,1,"pages",89,,,,,, +,"3b9b0ab6d387f6186973afb429f525dc","pages",92,"sys_language_uid",0,0,1,"sys_language",1,,,,,, diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php index 20c039b9195656335f92a83b0ff2d332454fbad1..2c6e11eadbd142192af26681860fcdc7abb2d47e 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php @@ -60,6 +60,19 @@ class ActionTest extends AbstractActionTestCase ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', 'Testing #1 (copy 1)')); } + /** + * @test + */ + public function createContentAndLocalize() + { + parent::createContentAndLocalize(); + $this->assertAssertionDataSet('createContentAndLocalize'); + + $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections(); + self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() + ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1')); + } + /** * @test */ diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/DataSet/createContentAndLocalize.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/DataSet/createContentAndLocalize.csv new file mode 100644 index 0000000000000000000000000000000000000000..e09e64462c6922a460554926bfae7336b662a6ca --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/DataSet/createContentAndLocalize.csv @@ -0,0 +1,25 @@ +"tt_content",,,,,,,,,,,,,,, +,"uid","pid","sorting","deleted","hidden","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header" +,296,88,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #0" +,297,89,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #1" +,298,89,512,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #2" +,299,89,768,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #3" +,300,89,1024,0,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3" +,301,89,384,0,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1" +,302,89,448,0,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1" +,310,90,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #10" +,311,90,512,0,0,1,0,310,310,0,0,0,0,0,"[Translate to Dansk:] Regular Element #10" +,312,90,768,0,0,2,0,311,311,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10" +,320,89,512,0,0,0,0,0,298,2,2,0,298,0,"Regular Element #2" +,321,89,128,0,0,0,0,0,0,1,1,0,0,0,"Testing #1" +,322,89,128,0,0,0,0,0,0,1,-1,0,321,0,"Testing #1" +,323,89,192,0,0,1,321,321,321,1,1,0,0,0,"[Translate to Dansk:] Testing #1" +,324,89,192,0,0,1,321,321,321,1,-1,0,323,0,"[Translate to Dansk:] Testing #1" +"sys_refindex",,,,,,,,,,,,,,, +,"hash","tablename","recuid","field","sorting","deleted","workspace","ref_table","ref_uid",,,,,, +,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",0,0,0,"sys_workspace_stage",1,,,,,, +,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",0,0,0,"be_users",3,,,,,, +,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",0,0,0,"sys_category",28,,,,,, +,"620500aee65485a0aed7d1ee2d0eff17","pages",92,"l10n_parent",0,0,1,"pages",89,,,,,, +,"3b9b0ab6d387f6186973afb429f525dc","pages",92,"sys_language_uid",0,0,1,"sys_language",1,,,,,, +,"2301fede2308207f11730966d2088fdf","tt_content",324,"l18n_parent",0,0,1,"tt_content",321,,,,,, diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/ActionTest.php index b56a07cfe341dc5bea64ac0b7235c27022a4eed5..17f3c62866718640e1b26e669e3c631e33e08dd4 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/ActionTest.php @@ -598,6 +598,22 @@ class ActionTest extends AbstractActionTestCase ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1')); } + /** + * @test + */ + public function createContentAndLocalize() + { + parent::createContentAndLocalize(); + $this->actionService->publishRecords([ + self::TABLE_Content => [$this->recordIds['newContentId']], + ]); + $this->assertAssertionDataSet('createContentAndLocalize'); + + $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections(); + self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() + ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1')); + } + /** * @test */ diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/DataSet/createContentAndLocalize.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/DataSet/createContentAndLocalize.csv new file mode 100644 index 0000000000000000000000000000000000000000..7bddb40c832655fe6b0a22e206ccf29731ca8f90 --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/DataSet/createContentAndLocalize.csv @@ -0,0 +1,24 @@ +"tt_content",,,,,,,,,,,,,,, +,"uid","pid","sorting","deleted","hidden","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header" +,296,88,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #0" +,297,89,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #1" +,298,89,512,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #2" +,299,89,768,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #3" +,300,89,1024,0,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3" +,301,89,384,0,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1" +,302,89,448,0,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1" +,310,90,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #10" +,311,90,512,0,0,1,0,310,310,0,0,0,0,0,"[Translate to Dansk:] Regular Element #10" +,312,90,768,0,0,2,0,311,311,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10" +,320,89,512,0,0,0,0,0,298,2,2,0,298,0,"Regular Element #2" +,321,89,128,0,0,0,0,0,0,0,0,0,0,0,"Testing #1" +,323,89,192,0,0,1,321,321,321,1,1,0,0,0,"[Translate to Dansk:] Testing #1" +,324,89,192,0,0,1,321,321,321,1,-1,0,323,0,"[Translate to Dansk:] Testing #1" +"sys_refindex",,,,,,,,,,,,,,, +,"hash","tablename","recuid","field","sorting","deleted","workspace","ref_table","ref_uid",,,,,, +,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",0,0,0,"sys_workspace_stage",1,,,,,, +,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",0,0,0,"be_users",3,,,,,, +,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",0,0,0,"sys_category",28,,,,,, +,"620500aee65485a0aed7d1ee2d0eff17","pages",92,"l10n_parent",0,0,1,"pages",89,,,,,, +,"3b9b0ab6d387f6186973afb429f525dc","pages",92,"sys_language_uid",0,0,1,"sys_language",1,,,,,, +,"2301fede2308207f11730966d2088fdf","tt_content",324,"l18n_parent",0,0,1,"tt_content",321,,,,,, diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/ActionTest.php index e38bb54c2bed2c76ff85183dd062032235d3959d..4ed79498c7ff22373a029662b90d4f6e4db5e727 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/ActionTest.php @@ -596,6 +596,20 @@ class ActionTest extends AbstractActionTestCase $this->assertAssertionDataSet('createNestedPagesAndCopyDraftParentPage'); } + /** + * @test + */ + public function createContentAndLocalize() + { + parent::createContentAndLocalize(); + $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); + $this->assertAssertionDataSet('createContentAndLocalize'); + + $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections(); + self::assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() + ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1')); + } + /** * @test * @group not-postgres diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/DataSet/createContentAndLocalize.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/DataSet/createContentAndLocalize.csv new file mode 100644 index 0000000000000000000000000000000000000000..7c4ef5564491b659d247c430cd4bf97f33e65bea --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/DataSet/createContentAndLocalize.csv @@ -0,0 +1,23 @@ +"tt_content",,,,,,,,,,,,,,, +,"uid","pid","sorting","deleted","hidden","sys_language_uid","l18n_parent","l10n_source","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header" +,296,88,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #0" +,297,89,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #1" +,298,89,512,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #2" +,299,89,768,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #3" +,300,89,1024,0,0,1,299,299,299,0,0,0,0,0,"[Translate to Dansk:] Regular Element #3" +,301,89,384,0,0,1,297,297,297,0,0,0,0,0,"[Translate to Dansk:] Regular Element #1" +,302,89,448,0,0,2,297,301,301,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1" +,310,90,256,0,0,0,0,0,0,0,0,0,0,0,"Regular Element #10" +,311,90,512,0,0,1,0,310,310,0,0,0,0,0,"[Translate to Dansk:] Regular Element #10" +,312,90,768,0,0,2,0,311,311,0,0,0,0,0,"[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10" +,320,89,512,0,0,0,0,0,298,2,2,0,298,0,"Regular Element #2" +,321,89,128,0,0,0,0,0,0,0,0,0,0,0,"Testing #1" +,323,89,192,0,0,1,321,321,321,0,0,0,0,0,"[Translate to Dansk:] Testing #1" +"sys_refindex",,,,,,,,,,,,,,, +,"hash","tablename","recuid","field","sorting","deleted","workspace","ref_table","ref_uid",,,,,, +,"25426f92d44dd2ccf416108462b446e3","sys_workspace",1,"custom_stages",0,0,0,"sys_workspace_stage",1,,,,,, +,"01a3ce8c4e3b2bb1aa439dc29081f996","sys_workspace_stage",1,"responsible_persons",0,0,0,"be_users",3,,,,,, +,"1b70a8e25c22645f7a49a79f57f3cf3f","sys_category",31,"parent",0,0,0,"sys_category",28,,,,,, +,"7495604375ab4caae25ea3da5e76f6c3","pages",91,"l10n_parent",0,0,0,"pages",89,,,,,, +,"885fa8b0049daa6a9f6989e7bc55ae11","pages",91,"sys_language_uid",0,0,0,"sys_language",1,,,,,, +,"c353af3d7aa4b77147d6ae872a2968d8","tt_content",323,"l18n_parent",0,0,0,"tt_content",321,,,,,,