diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php index 326fe356739bbc64f670079005319523b4bf7ee1..df63623ede789c01ca0a9de910bd15395fd75a45 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php @@ -39,6 +39,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D const VALUE_CategoryIdFirst = 28; const VALUE_CategoryIdSecond = 29; + const TABLE_Page = 'pages'; const TABLE_Content = 'tt_content'; const TABLE_Category = 'sys_category'; const TABLE_ContentCategory_ManyToMany = 'sys_category_record_mm'; @@ -267,4 +268,28 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D ); } + /** + * @test + * @see DataSet/Assertion/copyPage.csv + */ + public function copyPage() { + $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget); + $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId]; + $this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst]; + $this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast]; + $this->assertAssertionDataSet('copyPage'); + + $responseContent = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseContent(); + $this->assertResponseContentHasRecords($responseContent, self::TABLE_Page, 'title', 'Relations'); + $this->assertResponseContentHasRecords($responseContent, self::TABLE_Content, 'header', array('Regular Element #1', 'Regular Element #2')); + $this->assertResponseContentStructureHasRecords( + $responseContent, self::TABLE_Content . ':' . $this->recordIds['newContentIdFirst'], 'categories', + self::TABLE_Category, 'title', array('Category A', 'Category B') + ); + $this->assertResponseContentStructureHasRecords( + $responseContent, self::TABLE_Content . ':' . $this->recordIds['newContentIdLast'], 'categories', + self::TABLE_Category, 'title', array('Category B', 'Category C') + ); + } + } diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/DataSet/Assertion/copyPage.csv b/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/DataSet/Assertion/copyPage.csv new file mode 100644 index 0000000000000000000000000000000000000000..83e8b718c507a4deed9c70465d42d96fc1671a63 --- /dev/null +++ b/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/DataSet/Assertion/copyPage.csv @@ -0,0 +1,29 @@ +pages +,uid,pid,sorting,deleted,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title +,1,0,256,0,0,0,0,0,0,FunctionalTest +,88,1,256,0,0,0,0,0,0,DataHandlerTest +,89,88,256,0,0,0,0,0,0,Relations +,90,88,512,0,0,0,0,0,0,Target +,91,90,256,0,0,0,0,0,0,Relations +sys_category +,uid,pid,sorting,deleted,sys_language_uid,l10n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parent,items +,28,0,256,0,0,0,0,0,0,0,0,"Category A",0,0 +,29,0,512,0,0,0,0,0,0,0,0,"Category B",0,0 +,30,0,768,0,0,0,0,0,0,0,0,"Category C",0,0 +,31,0,1024,0,0,0,0,0,0,0,0,"Category A.A",28,0 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,sorting,sorting_foreign,fieldname +,28,297,tt_content,0,1,categories +,29,297,tt_content,0,2,categories +,29,298,tt_content,0,1,categories +,30,298,tt_content,0,2,categories +,29,299,tt_content,0,1,categories +,30,299,tt_content,0,2,categories +,28,300,tt_content,0,1,categories +,29,300,tt_content,0,2,categories +tt_content +,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header,image,categories +,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",,2 +,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",,2 +,299,91,256,0,0,0,0,0,0,0,0,"Regular Element #2",0,2 +,300,91,128,0,0,0,0,0,0,0,0,"Regular Element #1",0,2 diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php index 79061432d53f5064e7f364bbf964b933099de270..8fb80f2b58400f6d4f64af6b5f0c8018b2fbcb00 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php @@ -41,6 +41,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D const VALUE_CategoryIdLast = 31; const VALUE_WorkspaceId = 1; + const TABLE_Page = 'pages'; const TABLE_Content = 'tt_content'; const TABLE_Category = 'sys_category'; const TABLE_ContentCategory_ManyToMany = 'sys_category_record_mm'; @@ -231,4 +232,14 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget); } + /** + * @see DataSet/Assertion/copyPage.csv + */ + public function copyPage() { + $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_PageIdTarget); + $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageId]; + $this->recordIds['newContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdFirst]; + $this->recordIds['newContentIdLast'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast]; + } + } diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php index a265d024c488bc8d2016e4696e7bf63c1f2c6d87..b860a649147d88fcc81a1be652827fa45e3a6479 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php @@ -306,4 +306,25 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Man ); } + /** + * @test + * @see DataSet/Assertion/copyPage.csv + */ + public function copyPage() { + parent::copyPage(); + $this->assertAssertionDataSet('copyPage'); + + $responseContent = $this->getFrontendResponse($this->recordIds['newPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseContent(); + $this->assertResponseContentHasRecords($responseContent, self::TABLE_Page, 'title', 'Relations'); + $this->assertResponseContentHasRecords($responseContent, self::TABLE_Content, 'header', array('Regular Element #1', 'Regular Element #2')); + $this->assertResponseContentStructureHasRecords( + $responseContent, self::TABLE_Content . ':' . $this->recordIds['newContentIdFirst'], 'categories', + self::TABLE_Category, 'title', array('Category A', 'Category B') + ); + $this->assertResponseContentStructureHasRecords( + $responseContent, self::TABLE_Content . ':' . $this->recordIds['newContentIdLast'], 'categories', + self::TABLE_Category, 'title', array('Category B', 'Category C') + ); + } + } diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/copyPage.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/copyPage.csv new file mode 100644 index 0000000000000000000000000000000000000000..cbb1f3d49a57015d35243a2aa784c152ddec834b --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/DataSet/copyPage.csv @@ -0,0 +1,32 @@ +pages +,uid,pid,sorting,deleted,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title +,1,0,256,0,0,0,0,0,0,FunctionalTest +,88,1,256,0,0,0,0,0,0,DataHandlerTest +,89,88,256,0,0,0,0,0,0,Relations +,90,88,512,0,0,0,0,0,0,Target +,91,90,256,0,1,1,0,0,0,Relations +,92,-1,256,0,1,-1,0,91,0,Relations +sys_category +,uid,pid,sorting,deleted,sys_language_uid,l10n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parent,items +,28,0,256,0,0,0,0,0,0,0,0,"Category A",0,0 +,29,0,512,0,0,0,0,0,0,0,0,"Category B",0,0 +,30,0,768,0,0,0,0,0,0,0,0,"Category C",0,0 +,31,0,1024,0,0,0,0,0,0,0,0,"Category A.A",28,0 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,sorting,sorting_foreign,fieldname +,28,297,tt_content,0,1,categories +,29,297,tt_content,0,2,categories +,29,298,tt_content,0,1,categories +,30,298,tt_content,0,2,categories +,29,300,tt_content,0,1,categories +,30,300,tt_content,0,2,categories +,28,302,tt_content,0,1,categories +,29,302,tt_content,0,2,categories +tt_content +,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header,image,categories +,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",,2 +,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",,2 +,299,91,256,0,0,0,1,1,0,0,0,"Regular Element #2",,2 +,300,-1,256,0,0,0,1,-1,0,299,0,"Regular Element #2",0,2 +,301,91,128,0,0,0,1,1,0,0,0,"Regular Element #1",,2 +,302,-1,128,0,0,0,1,-1,0,301,0,"Regular Element #1",0,2 diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php index 80d7146eebae2498ced0a497cdc27868167f9239..e2ef41436ba3909841a9ccab24e77f3b6ea7731e 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php @@ -339,4 +339,31 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Man ); } + /** + * @test + * @see DataSet/Assertion/copyPage.csv + */ + public function copyPage() { + parent::copyPage(); + $this->actionService->publishRecords( + array( + self::TABLE_Page => array($this->recordIds['newPageId']), + self::TABLE_Content => array($this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']), + ) + ); + $this->assertAssertionDataSet('copyPage'); + + $responseContent = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseContent(); + $this->assertResponseContentHasRecords($responseContent, self::TABLE_Page, 'title', 'Relations'); + $this->assertResponseContentHasRecords($responseContent, self::TABLE_Content, 'header', array('Regular Element #1', 'Regular Element #2')); + $this->assertResponseContentStructureHasRecords( + $responseContent, self::TABLE_Content . ':' . $this->recordIds['newContentIdFirst'], 'categories', + self::TABLE_Category, 'title', array('Category A', 'Category B') + ); + $this->assertResponseContentStructureHasRecords( + $responseContent, self::TABLE_Content . ':' . $this->recordIds['newContentIdLast'], 'categories', + self::TABLE_Category, 'title', array('Category B', 'Category C') + ); + } + } diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/DataSet/copyPage.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/DataSet/copyPage.csv new file mode 100644 index 0000000000000000000000000000000000000000..c663c246177e4af61d029b0230e43f06869c0cc1 --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/DataSet/copyPage.csv @@ -0,0 +1,29 @@ +pages +,uid,pid,sorting,deleted,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title +,1,0,256,0,0,0,0,0,0,FunctionalTest +,88,1,256,0,0,0,0,0,0,DataHandlerTest +,89,88,256,0,0,0,0,0,0,Relations +,90,88,512,0,0,0,0,0,0,Target +,91,90,256,0,0,0,0,0,0,Relations +sys_category +,uid,pid,sorting,deleted,sys_language_uid,l10n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parent,items +,28,0,256,0,0,0,0,0,0,0,0,"Category A",0,0 +,29,0,512,0,0,0,0,0,0,0,0,"Category B",0,0 +,30,0,768,0,0,0,0,0,0,0,0,"Category C",0,0 +,31,0,1024,0,0,0,0,0,0,0,0,"Category A.A",28,0 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,sorting,sorting_foreign,fieldname +,28,297,tt_content,0,1,categories +,29,297,tt_content,0,2,categories +,29,298,tt_content,0,1,categories +,30,298,tt_content,0,2,categories +,29,299,tt_content,0,1,categories +,30,299,tt_content,0,2,categories +,28,301,tt_content,0,1,categories +,29,301,tt_content,0,2,categories +tt_content +,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header,image,categories +,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",,2 +,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",,2 +,299,91,256,0,0,0,0,0,0,0,0,"Regular Element #2",0,2 +,301,91,128,0,0,0,0,0,0,0,0,"Regular Element #1",0,2 diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php index ed09e53504630a99354f8ee0f964fa8922dff87e..1c36171decd9822edf99525c7af58e14916e4fd4 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php @@ -323,4 +323,26 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Man ); } + /** + * @test + * @see DataSet/Assertion/copyPage.csv + */ + public function copyPage() { + parent::copyPage(); + $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); + $this->assertAssertionDataSet('copyPage'); + + $responseContent = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseContent(); + $this->assertResponseContentHasRecords($responseContent, self::TABLE_Page, 'title', 'Relations'); + $this->assertResponseContentHasRecords($responseContent, self::TABLE_Content, 'header', array('Regular Element #1', 'Regular Element #2')); + $this->assertResponseContentStructureHasRecords( + $responseContent, self::TABLE_Content . ':' . $this->recordIds['newContentIdFirst'], 'categories', + self::TABLE_Category, 'title', array('Category A', 'Category B') + ); + $this->assertResponseContentStructureHasRecords( + $responseContent, self::TABLE_Content . ':' . $this->recordIds['newContentIdLast'], 'categories', + self::TABLE_Category, 'title', array('Category B', 'Category C') + ); + } + } diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/DataSet/copyPage.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/DataSet/copyPage.csv new file mode 100644 index 0000000000000000000000000000000000000000..c663c246177e4af61d029b0230e43f06869c0cc1 --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/DataSet/copyPage.csv @@ -0,0 +1,29 @@ +pages +,uid,pid,sorting,deleted,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title +,1,0,256,0,0,0,0,0,0,FunctionalTest +,88,1,256,0,0,0,0,0,0,DataHandlerTest +,89,88,256,0,0,0,0,0,0,Relations +,90,88,512,0,0,0,0,0,0,Target +,91,90,256,0,0,0,0,0,0,Relations +sys_category +,uid,pid,sorting,deleted,sys_language_uid,l10n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parent,items +,28,0,256,0,0,0,0,0,0,0,0,"Category A",0,0 +,29,0,512,0,0,0,0,0,0,0,0,"Category B",0,0 +,30,0,768,0,0,0,0,0,0,0,0,"Category C",0,0 +,31,0,1024,0,0,0,0,0,0,0,0,"Category A.A",28,0 +sys_category_record_mm +,uid_local,uid_foreign,tablenames,sorting,sorting_foreign,fieldname +,28,297,tt_content,0,1,categories +,29,297,tt_content,0,2,categories +,29,298,tt_content,0,1,categories +,30,298,tt_content,0,2,categories +,29,299,tt_content,0,1,categories +,30,299,tt_content,0,2,categories +,28,301,tt_content,0,1,categories +,29,301,tt_content,0,2,categories +tt_content +,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header,image,categories +,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",,2 +,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",,2 +,299,91,256,0,0,0,0,0,0,0,0,"Regular Element #2",0,2 +,301,91,128,0,0,0,0,0,0,0,0,"Regular Element #1",0,2