[TASK] Add functional test cases for IRRE children without default sortby 39/42839/3
authorOliver Hader <oliver@typo3.org>
Sat, 22 Aug 2015 12:40:48 +0000 (14:40 +0200)
committerBenni Mack <benni@typo3.org>
Fri, 18 Sep 2015 12:53:35 +0000 (14:53 +0200)
In each, live and draft workspace:
* create a tt_content element
* with a nested 1:n hotel element
* with a nested 1:n offer element
* localize the created tt_conent element

The default sortby configuration of the hotel
table is disabled in $TCA.

Resolves: #59112
Releases: master, 6.2
Change-Id: I8e8eae3100046d21b7348cce7af6b592928b7c99
Reviewed-on: http://review.typo3.org/42839
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php
typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv [new file with mode: 0644]
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv [new file with mode: 0644]

index cbc2728..99b3555 100644 (file)
@@ -260,6 +260,25 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
        }
 
        /**
+        * @see DataSet/Assertion/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecords.csv
+        */
+       public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration() {
+               unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['sortby']);
+               $newTableIds = $this->actionService->createNewRecords(
+                       self::VALUE_PageId,
+                       array(
+                               self::TABLE_Content => array('header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'),
+                               self::TABLE_Hotel => array('title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'),
+                               self::TABLE_Offer => array('title' => 'Offer #1'),
+                       )
+               );
+               $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
+               $this->recordIds['newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
+               $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
+               $this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds['newContentId']];
+       }
+
+       /**
         * @see DataSet/Assertion/modifyOnlyHotelChildRecord.csv
         */
        public function modifyOnlyHotelChild() {
index 1120ad2..d90c17e 100644 (file)
@@ -322,6 +322,25 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
 
        /**
         * @test
+        * @see DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv
+        */
+       public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration() {
+               parent::createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration();
+               $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenWOSortBy');
+
+               $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
+               $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
+                       ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
+               $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+                       ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
+                       ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
+               $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+                       ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
+                       ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
+       }
+
+       /**
+        * @test
         * @see DataSet/Assertion/modifyOnlyHotelChildRecord.csv
         */
        public function modifyOnlyHotelChild() {
diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv b/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv
new file mode 100644 (file)
index 0000000..3376d9b
--- /dev/null
@@ -0,0 +1,30 @@
+tt_content
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header,tx_irretutorial_1nff_hotels
+,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",1
+,299,89,128,0,0,0,0,0,0,0,0,"Testing #1",1
+,300,89,192,0,1,299,0,0,0,0,0,"[Translate to Dansk:] Testing #1",1
+tx_irretutorial_1nff_hotel
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,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,0,"Hotel #1",297,tt_content,,2
+,4,89,2,0,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
+,5,89,1,0,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
+,6,89,0,0,0,0,0,0,0,0,0,"Hotel #1",299,tt_content,,1
+,7,89,0,0,1,6,0,0,0,0,0,"[Translate to Dansk:] Hotel #1",300,tt_content,,1
+tx_irretutorial_1nff_offer
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,prices
+,5,89,512,0,0,0,0,0,0,0,0,"Offer #1.1",3,tx_irretutorial_1nff_hotel,,3
+,6,89,1792,0,0,0,0,0,0,0,0,"Offer #1.2",3,tx_irretutorial_1nff_hotel,,2
+,7,89,768,0,0,0,0,0,0,0,0,"Offer #2.1",4,tx_irretutorial_1nff_hotel,,1
+,8,89,1024,0,0,0,0,0,0,0,0,"Offer #1.1",5,tx_irretutorial_1nff_hotel,,1
+,9,89,1280,0,0,0,0,0,0,0,0,"Offer #1",6,tx_irretutorial_1nff_hotel,,0
+,10,89,1,0,1,9,0,0,0,0,0,"[Translate to Dansk:] Offer #1",7,tx_irretutorial_1nff_hotel,,0
+tx_irretutorial_1nff_price
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,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,0,"Price #1.1.1",5,tx_irretutorial_1nff_offer,
+,8,89,2,0,0,0,0,0,0,0,0,"Price #1.1.2",5,tx_irretutorial_1nff_offer,
+,9,89,3,0,0,0,0,0,0,0,0,"Price #1.1.3",5,tx_irretutorial_1nff_offer,
+,10,89,1,0,0,0,0,0,0,0,0,"Price #1.2.1",6,tx_irretutorial_1nff_offer,
+,11,89,2,0,0,0,0,0,0,0,0,"Price #1.2.2",6,tx_irretutorial_1nff_offer,
+,12,89,1,0,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,0,"Price #1.1.1",8,tx_irretutorial_1nff_offer,
index 8ed8458..3fd56d9 100644 (file)
@@ -306,6 +306,25 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
        }
 
        /**
+        * @see DataSet/Assertion/createAndLocalizeParentContentRecordWithHotelAndOfferChildRecords.csv
+        */
+       public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration() {
+               unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['sortby']);
+               $newTableIds = $this->actionService->createNewRecords(
+                       self::VALUE_PageId,
+                       array(
+                               self::TABLE_Content => array('header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'),
+                               self::TABLE_Hotel => array('title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'),
+                               self::TABLE_Offer => array('title' => 'Offer #1'),
+                       )
+               );
+               $this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][0];
+               $this->recordIds['newHotelId'] = $newTableIds[self::TABLE_Hotel][0];
+               $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
+               $this->recordIds['localizedContentId'] = $localizedTableIds[self::TABLE_Content][$this->recordIds['newContentId']];
+       }
+
+       /**
         * @see DataSet/Assertion/createNLocalizeParentContentNHotelNOfferChildrenNDiscardCreatedParent.csv
         */
        public function createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent() {
index 86b8a9f..e44d158 100644 (file)
@@ -353,6 +353,25 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR
 
        /**
         * @test
+        * @see DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv
+        */
+       public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration() {
+               parent::createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration();
+               $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenWOSortBy');
+
+               $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections('Default', 'Extbase:list()');
+               $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
+                       ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
+               $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+                       ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
+                       ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
+               $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
+                       ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['newHotelId'])->setRecordField(self::FIELD_HotelOffer)
+                       ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
+       }
+
+       /**
+        * @test
         * @see DataSet/Assertion/createNLocalizeParentContentNHotelNOfferChildrenNDiscardCreatedParent.csv
         */
        public function createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent() {
diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/DataSet/createNLocalizeParentContentNHotelNOfferChildrenWOSortBy.csv
new file mode 100644 (file)
index 0000000..8822d28
--- /dev/null
@@ -0,0 +1,36 @@
+tt_content
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,header,tx_irretutorial_1nff_hotels
+,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",1
+,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",1
+,301,89,192,0,1,299,1,1,0,0,0,"[Translate to Dansk:] Testing #1",0
+,302,-1,192,0,1,299,1,-1,0,301,0,"[Translate to Dansk:] Testing #1",1
+tx_irretutorial_1nff_hotel
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,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,0,"Hotel #1",297,tt_content,,2
+,4,89,2,0,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
+,5,89,1,0,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
+,6,89,0,0,0,0,1,1,0,0,0,"Hotel #1",299,tt_content,,0
+,7,-1,0,0,0,0,1,-1,0,6,0,"Hotel #1",299,tt_content,,1
+,8,89,0,0,1,6,1,1,0,0,0,"[Translate to Dansk:] Hotel #1",301,tt_content,,0
+,9,-1,0,0,1,6,1,-1,0,8,0,"[Translate to Dansk:] Hotel #1",301,tt_content,,1
+tx_irretutorial_1nff_offer
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,prices
+,5,89,512,0,0,0,0,0,0,0,0,"Offer #1.1",3,tx_irretutorial_1nff_hotel,,3
+,6,89,1792,0,0,0,0,0,0,0,0,"Offer #1.2",3,tx_irretutorial_1nff_hotel,,2
+,7,89,768,0,0,0,0,0,0,0,0,"Offer #2.1",4,tx_irretutorial_1nff_hotel,,1
+,8,89,1024,0,0,0,0,0,0,0,0,"Offer #1.1",5,tx_irretutorial_1nff_hotel,,1
+,9,89,1280,0,0,0,1,1,0,0,0,"Offer #1",6,tx_irretutorial_1nff_hotel,,0
+,10,-1,1,0,0,0,1,-1,0,9,0,"Offer #1",6,tx_irretutorial_1nff_hotel,,0
+,11,89,1,0,1,9,1,1,0,0,0,"[Translate to Dansk:] Offer #1",8,tx_irretutorial_1nff_hotel,,0
+,12,-1,1536,0,1,9,1,-1,0,11,0,"[Translate to Dansk:] Offer #1",8,tx_irretutorial_1nff_hotel,,0
+tx_irretutorial_1nff_price
+,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,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,0,"Price #1.1.1",5,tx_irretutorial_1nff_offer,
+,8,89,2,0,0,0,0,0,0,0,0,"Price #1.1.2",5,tx_irretutorial_1nff_offer,
+,9,89,3,0,0,0,0,0,0,0,0,"Price #1.1.3",5,tx_irretutorial_1nff_offer,
+,10,89,1,0,0,0,0,0,0,0,0,"Price #1.2.1",6,tx_irretutorial_1nff_offer,
+,11,89,2,0,0,0,0,0,0,0,0,"Price #1.2.2",6,tx_irretutorial_1nff_offer,
+,12,89,1,0,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,0,"Price #1.1.1",8,tx_irretutorial_1nff_offer,