[TASK] Streamline DataHandler functional tests 48/27648/2
authorOliver Hader <oliver@typo3.org>
Mon, 17 Feb 2014 06:41:23 +0000 (07:41 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 17 Feb 2014 07:18:59 +0000 (08:18 +0100)
* load modified typo3conf/extTables.php
* add label for copied records
* add label for localized records
* streamline test assertion of IRRE reference test

Resolves: #56029
Releases: 6.2
Change-Id: I4b60200c568aa17e8d51cae95567fe045bff62c7
Reviewed-on: https://review.typo3.org/27648
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/Framework/ActionService.php
typo3/sysext/core/Tests/Functional/DataHandling/InlineRelationalRecordEditing/ForeignField/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/InlineRelationalRecordEditing/ForeignField/DataSet/Assertion/modifyParentRecordWithHotelChildRecord.csv
typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/DataSet/Assertion/copyCategoryRecordOfCategoryRelation.csv
typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/DataSet/Assertion/localizeCategoryRecordOfCategoryRelation.csv
typo3/sysext/core/Tests/Functional/Fixtures/Frontend/extTables.php [new file with mode: 0644]
typo3/sysext/workspaces/Tests/Functional/DataHandling/InlineRelationalRecordEditing/ForeignField/AbstractActionTestCase.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/InlineRelationalRecordEditing/ForeignField/DataSet/Assertion/modifyParentRecordWithHotelChildRecord.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/DataSet/Assertion/copyCategoryRecordOfCategoryRelation.csv
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/DataSet/Assertion/localizeCategoryRecordOfCategoryRelation.csv

index 7cc748b..6ce9222 100644 (file)
@@ -46,6 +46,13 @@ abstract class AbstractDataHandlerActionTestCase extends \TYPO3\CMS\Core\Tests\F
        );
 
        /**
+        * @var array
+        */
+       protected $pathsToLinkInTestInstance = array(
+               'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/extTables.php' => 'typo3conf/extTables.php',
+       );
+
+       /**
         * @var \TYPO3\CMS\Core\Tests\Functional\DataHandling\Framework\ActionService
         */
        protected $actionService;
index bdbdc2f..7812a29 100644 (file)
@@ -61,9 +61,10 @@ class ActionService {
         * @param string $tableName
         * @param integer $pageId
         * @param array $recordData
+        * @return array
         */
        public function createNewRecord($tableName, $pageId, array $recordData) {
-               $this->createNewRecords($pageId, array($tableName => $recordData));
+               return $this->createNewRecords($pageId, array($tableName => $recordData));
        }
 
        /**
@@ -178,6 +179,7 @@ class ActionService {
                );
                $this->dataHandler->start(array(), $commandMap);
                $this->dataHandler->process_cmdmap();
+               return $this->dataHandler->copyMappingArray;
        }
 
        /**
@@ -201,6 +203,7 @@ class ActionService {
         * @param string $tableName
         * @param integer $uid
         * @param integer $languageId
+        * @return array
         */
        public function localizeRecord($tableName, $uid, $languageId) {
                $commandMap = array(
@@ -212,6 +215,7 @@ class ActionService {
                );
                $this->dataHandler->start(array(), $commandMap);
                $this->dataHandler->process_cmdmap();
+               return $this->dataHandler->copyMappingArray;
        }
 
        /**
index 968c737..d584b54 100644 (file)
@@ -194,7 +194,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
                        self::VALUE_PageId,
                        array(
                                self::TABLE_Hotel => array('uid' => 4, 'title' => 'Testing #1'),
-                               self::TABLE_Content => array('uid' => self::VALUE_ContentIdLast, 'tx_irretutorial_hotels' => '3,4'),
+                               self::TABLE_Content => array('uid' => self::VALUE_ContentIdFirst, 'tx_irretutorial_hotels' => '3,4'),
                        )
                );
                $this->assertAssertionDataSet('modifyParentRecordWithHotelChildRecord');
index 5c8e9da..4df4b7c 100644 (file)
@@ -1,11 +1,11 @@
 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,tx_irretutorial_hotels
 ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",,0,2
-,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",,0,2
+,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",,0,1
 tx_irretutorial_1nff_hotel
 ,uid,pid,sorting,deleted,sys_language_uid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
-,3,89,1,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,2
-,4,89,2,0,0,0,0,0,0,0,"Testing #1",298,tt_content,,1
+,3,89,1,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
+,4,89,2,0,0,0,0,0,0,0,"Testing #1",297,tt_content,,1
 ,5,89,1,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
 tx_irretutorial_1nff_offer
 ,uid,pid,sorting,deleted,sys_language_uid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,prices
index 679c03d..eca185e 100644 (file)
@@ -4,7 +4,7 @@ sys_category
 ,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
-,32,0,128,0,0,0,0,0,0,0,0,"Category A",0,1
+,32,0,128,0,0,0,0,0,0,0,0,"Category A (copy 1)",0,1
 sys_category_record_mm
 ,uid_local,uid_foreign,tablenames,sorting,sorting_foreign,fieldname
 ,28,297,tt_content,0,1,categories
index 0c7b266..b8ddb17 100644 (file)
@@ -4,7 +4,7 @@ sys_category
 ,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
-,32,0,384,0,1,28,0,0,0,0,0,"Category A",0,1
+,32,0,384,0,1,28,0,0,0,0,0,"[Translate to Dansk:] Category A",0,1
 sys_category_record_mm
 ,uid_local,uid_foreign,tablenames,sorting,sorting_foreign,fieldname
 ,28,297,tt_content,0,1,categories
diff --git a/typo3/sysext/core/Tests/Functional/Fixtures/Frontend/extTables.php b/typo3/sysext/core/Tests/Functional/Fixtures/Frontend/extTables.php
new file mode 100644 (file)
index 0000000..43f279f
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Overriding $TCA
+ *
+ * The TYPO3 Configuration Array (TCA) is defined by the distributed tables.php and ext_tables.php files.
+ * If you want to extend and/or modify its content, you can do so with scripts like this.
+ * Or BETTER yet - with extensions like those found in the typo3conf/ext/ or typo3/ext/ folder.
+ * Extensions are movable to other TYPO3 installations and provides a much better division between things! Use them!
+ *
+ * Information on how to set up tables is found in the document "Inside TYPO3" available as a PDF from where you downloaded TYPO3.
+ *
+ * Usage:
+ * Just put this file to the location typo3conf/extTables.php and add this line to your typo3conf/localconf.php:
+ * $typo_db_extTableDef_script = 'extTables.php';
+ */
+
+// Show copied pages records in frontend request
+$GLOBALS['TCA']['pages']['ctrl']['hideAtCopy'] = FALSE;
+// Show copied tt_content records in frontend request
+$GLOBALS['TCA']['tt_content']['ctrl']['hideAtCopy'] = FALSE;
+// Prepend label for copied sys_category records
+$GLOBALS['TCA']['sys_category']['ctrl']['prependAtCopy'] = 'LLL:EXT:lang/locallang_general.xlf:LGL.prependAtCopy';
+// Prepend label for localized sys_category records
+$GLOBALS['TCA']['sys_category']['columns']['title']['l10n_mode'] = 'prefixLangTitle';
+
+?>
\ No newline at end of file
index 8c7e19b..f5da40f 100644 (file)
@@ -221,7 +221,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
                        self::VALUE_PageId,
                        array(
                                self::TABLE_Hotel => array('uid' => 4, 'title' => 'Testing #1'),
-                               self::TABLE_Content => array('uid' => self::VALUE_ContentIdLast, 'tx_irretutorial_hotels' => '3,4'),
+                               self::TABLE_Content => array('uid' => self::VALUE_ContentIdFirst, 'tx_irretutorial_hotels' => '3,4'),
                        )
                );
                $this->assertAssertionDataSet('modifyParentRecordWithHotelChildRecord');
index 6d4cecb..9a81e96 100644 (file)
@@ -2,14 +2,14 @@ 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,tx_irretutorial_hotels
 ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1",,0,2
 ,298,89,512,0,0,0,0,0,0,0,0,"Regular Element #2",,0,1
-,299,-1,512,0,0,0,1,0,0,298,0,"Regular Element #2",0,0,2
+,299,-1,256,0,0,0,1,0,0,297,0,"Regular Element #1",0,0,2
 tx_irretutorial_1nff_hotel
 ,uid,pid,sorting,deleted,sys_language_uid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
-,3,89,1,0,0,0,0,0,0,0,"Hotel #1",299,tt_content,,2
+,3,89,1,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
 ,4,89,2,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
 ,5,89,1,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
 ,6,-1,2,0,0,1,0,0,4,0,"Testing #1",299,tt_content,,1
-,7,-1,1,0,0,1,0,0,5,0,"Hotel #1",299,tt_content,,1
+,7,-1,1,0,0,1,0,0,3,0,"Hotel #1",299,tt_content,,2
 tx_irretutorial_1nff_offer
 ,uid,pid,sorting,deleted,sys_language_uid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,prices
 ,5,89,1,0,0,0,0,0,0,0,"Offer #1.1",3,tx_irretutorial_1nff_hotel,,3
@@ -17,7 +17,8 @@ tx_irretutorial_1nff_offer
 ,7,89,1,0,0,0,0,0,0,0,"Offer #2.1",4,tx_irretutorial_1nff_hotel,,1
 ,8,89,1,0,0,0,0,0,0,0,"Offer #1.1",5,tx_irretutorial_1nff_hotel,,1
 ,9,-1,1,0,0,1,0,0,7,0,"Offer #2.1",6,tx_irretutorial_1nff_hotel,,1
-,10,-1,1,0,0,1,0,0,8,0,"Offer #1.1",7,tx_irretutorial_1nff_hotel,,1
+,10,-1,1,0,0,1,0,0,5,0,"Offer #1.1",7,tx_irretutorial_1nff_hotel,,3
+,11,-1,2,0,0,1,0,0,6,0,"Offer #1.2",7,tx_irretutorial_1nff_hotel,,2
 tx_irretutorial_1nff_price
 ,uid,pid,sorting,deleted,sys_language_uid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier
 ,7,89,1,0,0,0,0,0,0,0,"Price #1.1.1",5,tx_irretutorial_1nff_offer,
@@ -28,4 +29,8 @@ tx_irretutorial_1nff_price
 ,12,89,1,0,0,0,0,0,0,0,"Price #2.1.1",7,tx_irretutorial_1nff_offer,
 ,13,89,1,0,0,0,0,0,0,0,"Price #1.1.1",8,tx_irretutorial_1nff_offer,
 ,14,-1,1,0,0,1,0,0,12,0,"Price #2.1.1",9,tx_irretutorial_1nff_offer,
-,15,-1,1,0,0,1,0,0,13,0,"Price #1.1.1",10,tx_irretutorial_1nff_offer,
+,15,-1,1,0,0,1,0,0,7,0,"Price #1.1.1",10,tx_irretutorial_1nff_offer,
+,16,-1,2,0,0,1,0,0,8,0,"Price #1.1.2",10,tx_irretutorial_1nff_offer,
+,17,-1,3,0,0,1,0,0,9,0,"Price #1.1.3",10,tx_irretutorial_1nff_offer,
+,18,-1,1,0,0,1,0,0,10,0,"Price #1.2.1",11,tx_irretutorial_1nff_offer,
+,19,-1,2,0,0,1,0,0,11,0,"Price #1.2.2",11,tx_irretutorial_1nff_offer,
index 77e2520..b268732 100644 (file)
@@ -4,8 +4,8 @@ sys_category
 ,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
-,32,0,128,0,0,0,1,1,0,0,0,"Category A",0,1
-,33,-1,128,0,0,0,1,-1,0,32,0,"Category A",0,1
+,32,0,128,0,0,0,1,1,0,0,0,"Category A (copy 1)",0,1
+,33,-1,128,0,0,0,1,-1,0,32,0,"Category A (copy 1)",0,1
 sys_category_record_mm
 ,uid_local,uid_foreign,tablenames,sorting,sorting_foreign,fieldname
 ,28,297,tt_content,0,1,categories
index 156a35c..1a6e604 100644 (file)
@@ -4,8 +4,8 @@ sys_category
 ,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
-,32,0,384,0,1,28,1,1,0,0,0,"Category A",0,1
-,33,-1,384,0,1,28,1,-1,0,32,0,"Category A",0,1
+,32,0,384,0,1,28,1,1,0,0,0,"[Translate to Dansk:] Category A",0,1
+,33,-1,384,0,1,28,1,-1,0,32,0,"[Translate to Dansk:] Category A",0,1
 sys_category_record_mm
 ,uid_local,uid_foreign,tablenames,sorting,sorting_foreign,fieldname
 ,28,297,tt_content,0,1,categories