[TASK] Add functional test covering copying a page translated in free mode 82/51082/3
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Sat, 31 Dec 2016 17:35:13 +0000 (18:35 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Sat, 31 Dec 2016 18:27:37 +0000 (19:27 +0100)
This test is a safe net before implementing features like l10n_source

Releases: master, 7.6
Resolves: #79126
Change-Id: I89f5b819735623a33468a8e5898a1b7825aa0c9b
Reviewed-on: https://review.typo3.org/51082
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/core/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/LivePageFreeModeElements.csv [new file with mode: 0644]
typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/DataSet/copyPageFreeMode.csv [new file with mode: 0644]

index c7c20ce..7e60842 100644 (file)
@@ -197,7 +197,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
 
     /**
      * @test
-     * @see DataSet/Assertion/copyPageRecord.csv
+     * @see DataSet/copyPage.csv
      */
     public function copyPage()
     {
@@ -207,6 +207,16 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
 
     /**
      * @test
+     * @see DataSet/copyPageFreeMode.csv
+     */
+    public function copyPageFreeMode()
+    {
+        $newTableIds = $this->actionService->copyRecord(self::TABLE_Page, self::VALUE_PageIdTarget, self::VALUE_PageIdTarget);
+        $this->recordIds['newPageId'] = $newTableIds[self::TABLE_Page][self::VALUE_PageIdTarget];
+    }
+
+    /**
+     * @test
      * @see DataSet/Assertion/localizePageRecord.csv
      */
     public function localizePage()
diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/LivePageFreeModeElements.csv b/typo3/sysext/core/Tests/Functional/DataHandling/Regular/DataSet/LivePageFreeModeElements.csv
new file mode 100644 (file)
index 0000000..34549d3
--- /dev/null
@@ -0,0 +1,5 @@
+tt_content,,,,,,,,,,,,,
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header
+,310,90,256,0,0,0,0,0,0,0,0,0,Regular Element #10
+,311,90,512,0,1,0,310,0,0,0,0,0,[Translate to Dansk:] Regular Element #10
+,312,90,768,0,2,0,311,0,0,0,0,0,[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10
index fdd2549..3938ab1 100644 (file)
@@ -252,7 +252,7 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
 
     /**
      * @test
-     * @see DataSet/Assertion/copyPageRecord.csv
+     * @see DataSet/copyPage.csv
      */
     public function copyPage()
     {
@@ -266,6 +266,21 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A
 
     /**
      * @test
+     * @see DataSet/copyPageFreeMode.csv
+     */
+    public function copyPageFreeMode()
+    {
+        $this->importScenarioDataSet('LivePageFreeModeElements');
+        parent::copyPageFreeMode();
+        $this->assertAssertionDataSet('copyPageFreeMode');
+
+        $responseSections = $this->getFrontendResponse($this->recordIds['newPageId'])->getResponseSections();
+        $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
+            ->setTable(self::TABLE_Page)->setField('title')->setValues('Target'));
+    }
+
+    /**
+     * @test
      * @see DataSet/Assertion/localizePageRecord.csv
      */
     public function localizePage()
diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/DataSet/copyPageFreeMode.csv b/typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/DataSet/copyPageFreeMode.csv
new file mode 100644 (file)
index 0000000..87ccdfb
--- /dev/null
@@ -0,0 +1,19 @@
+pages,,,,,,,,,,,,,
+,uid,pid,sorting,deleted,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,,
+,1,0,256,0,0,0,0,0,0,0,FunctionalTest,,
+,88,1,256,0,0,0,0,0,0,0,DataHandlerTest,,
+,89,88,256,0,0,0,0,0,0,0,Relations,,
+,90,88,512,0,0,0,0,0,0,0,Target,,
+,91,90,256,0,90,0,0,0,0,0,Target,,
+tt_content,,,,,,,,,,,,,
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header
+,297,89,256,0,0,0,0,0,0,0,0,0,Regular Element #1
+,298,89,512,0,0,0,0,0,0,0,0,0,Regular Element #2
+,299,89,768,0,0,0,0,0,0,0,0,0,Regular Element #3
+,300,89,1024,0,1,299,299,0,0,0,0,0,[Translate to Dansk:] Regular Element #3
+,310,90,256,0,0,0,0,0,0,0,0,0,Regular Element #10
+,311,90,512,0,1,0,310,0,0,0,0,0,[Translate to Dansk:] Regular Element #10
+,312,90,768,0,2,0,311,0,0,0,0,0,[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10
+,313,91,256,0,2,0,312,0,0,0,0,0,[Translate to Deutsch:] [Translate to Dansk:] Regular Element #10
+,314,91,128,0,1,0,311,0,0,0,0,0,[Translate to Dansk:] Regular Element #10
+,315,91,64,0,0,0,310,0,0,0,0,0,Regular Element #10