diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php index 1729d452c31bcaff3193a29bbfdc71353ed86077..f95075375f2d9f4d58c88f04ebef9e2df0cd9954 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php @@ -81,6 +81,37 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->assertResponseContentHasRecords($responseContent, self::TABLE_Content, 'header', array('Testing #1', 'Testing #2')); } + /** + * @test + */ + public function createContentRecordAndDiscardCreatedContentRecord() { + $newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, array('header' => 'Testing #1')); + $newContentId = $newTableIds[self::TABLE_Content][0]; + $versionedNewContentId = $this->actionService->getDataHander()->getAutoVersionId(self::TABLE_Content, $newContentId); + $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedNewContentId); + $this->assertAssertionDataSet('createContentRecordAndDiscardCreatedContentRecord'); + + $responseContent = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseContent(); + $this->assertResponseContentDoesNotHaveRecords($responseContent, self::TABLE_Content, 'header', 'Testing #1'); + } + + /** + * @test + */ + public function createAndCopyContentRecordAndDiscardCopiedContentRecord() { + $newTableIds = $this->actionService->createNewRecord(self::TABLE_Content, self::VALUE_PageId, array('header' => 'Testing #1')); + $newContentId = $newTableIds[self::TABLE_Content][0]; + $copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, $newContentId, self::VALUE_PageId); + $copiedContentId = $copiedTableIds[self::TABLE_Content][$newContentId]; + $versionedCopiedContentId = $this->actionService->getDataHander()->getAutoVersionId(self::TABLE_Content, $copiedContentId); + $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedCopiedContentId); + $this->assertAssertionDataSet('createAndCopyContentRecordAndDiscardCopiedContentRecord'); + + $responseContent = $this->getFrontendResponse(self::VALUE_PageId, 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseContent(); + $this->assertResponseContentHasRecords($responseContent, self::TABLE_Content, 'header', 'Testing #1'); + $this->assertResponseContentDoesNotHaveRecords($responseContent, self::TABLE_Content, 'header', 'Testing #1 (copy 1)'); + } + /** * @test */ diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/DataSet/Assertion/createAndCopyContentRecordAndDiscardCopiedContentRecord.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/DataSet/Assertion/createAndCopyContentRecordAndDiscardCopiedContentRecord.csv new file mode 100644 index 0000000000000000000000000000000000000000..4e6f1cfa7e5791817136cc30ad8f51e4cb4b6600 --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/DataSet/Assertion/createAndCopyContentRecordAndDiscardCopiedContentRecord.csv @@ -0,0 +1,8 @@ +tt_content +,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header,image,tx_irretutorial_1nff_hotels +,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",,0 +,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",,0 +,299,89,128,0,0,0,1,1,0,0,0,"Testing #1",,0 +,300,-1,128,0,0,0,1,-1,0,299,0,"Testing #1",,0 +,301,89,1000000000,1,0,0,0,1,0,0,0,"Testing #1 (copy 1)",,0 +,302,-1,1000000000,1,0,0,0,-1,0,301,0,"Testing #1 (copy 1)",0,0 diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/DataSet/Assertion/createContentRecordAndDiscardCreatedContentRecord.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/DataSet/Assertion/createContentRecordAndDiscardCreatedContentRecord.csv new file mode 100644 index 0000000000000000000000000000000000000000..5d756db8076aa3b0a49c8b99f6d54c0c5bd399df --- /dev/null +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/DataSet/Assertion/createContentRecordAndDiscardCreatedContentRecord.csv @@ -0,0 +1,6 @@ +tt_content +,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header,image,tx_irretutorial_1nff_hotels +,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",,0 +,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",,0 +,299,89,1000000000,1,0,0,0,1,0,0,0,"Testing #1",,0 +,300,-1,1000000000,1,0,0,0,-1,0,299,0,"Testing #1",,0