‪TYPO3CMS  9.5
AbstractActionTestCase.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 {
23 
27  protected ‪$scenarioDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/DataSet/';
28 
32  protected ‪$coreExtensionsToLoad = [
33  'fluid',
34  'workspaces',
35  ];
36 
37  protected function ‪setUp()
38  {
39  parent::setUp();
40  $this->‪importScenarioDataSet('ReferenceIndex');
41  $this->‪setWorkspaceId(self::VALUE_WorkspaceId);
42  }
43 
52  {
53  $newTableIds = $this->actionService->deleteRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
54  $versionedDeletedContentId = $newTableIds[‪self::TABLE_Content][‪self::VALUE_ContentIdLast];
55  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedDeletedContentId);
56  }
57 
66  {
67  ‪$GLOBALS['TCA']['tx_irretutorial_1nff_offer']['ctrl']['versioningWS'] = false;
68  $this->actionService->moveRecord(self::TABLE_Hotel, self::VALUE_HotelIdFirst, -self::VALUE_HotelIdSecond);
69  }
70 
75  {
76  $newTableIds = $this->actionService->createNewRecords(
77  self::VALUE_PageId,
78  [
79  self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
80  self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
81  self::TABLE_Offer => ['title' => 'Offer #1'],
82  ]
83  );
84  $this->recordIds['newContentId'] = $newTableIds['tt_content'][0];
85  $copiedTableIds = $this->actionService->copyRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_PageId);
86  $this->recordIds['copiedContentId'] = $copiedTableIds[‪self::TABLE_Content][$this->recordIds['newContentId']];
87  $versionedCopiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds['copiedContentId']);
88  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedCopiedContentId);
89  }
90 
95  {
96  $newTableIds = $this->actionService->createNewRecords(
97  self::VALUE_PageId,
98  [
99  self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
100  self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
101  self::TABLE_Offer => ['title' => 'Offer #1'],
102  ]
103  );
104  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
105  $this->recordIds['versionedNewContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds['newContentId']);
106  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
107  $this->recordIds['localizedContentId'] = $localizedTableIds[‪self::TABLE_Content][$this->recordIds['newContentId']];
108  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['versionedNewContentId']);
109  }
110 
115  {
116  $newTableIds = $this->actionService->createNewRecords(
117  self::VALUE_PageId,
118  [
119  self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
120  self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
121  self::TABLE_Offer => ['title' => 'Offer #1'],
122  ]
123  );
124  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
125  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
126  $this->recordIds['localizedContentId'] = $localizedTableIds[‪self::TABLE_Content][$this->recordIds['newContentId']];
127  $versionedLocalizedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds['localizedContentId']);
128  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedLocalizedContentId);
129  }
130 
135  {
136  $this->actionService->modifyRecords(
137  self::VALUE_PageId,
138  [
139  self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel => '3,4'],
140  self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #1'],
141  ]
142  );
143  $modifiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
144  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $modifiedContentId);
145  }
146 
151  {
152  $this->actionService->modifyRecords(
153  self::VALUE_PageId,
154  [
155  self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, self::FIELD_ContentHotel => '3,4'],
156  self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #1'],
157  ]
158  );
159  $modifiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
160  $modifiedHotelId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 4);
161  $this->actionService->clearWorkspaceRecords(
162  [
163  self::TABLE_Content => [$modifiedContentId],
164  self::TABLE_Hotel => [$modifiedHotelId],
165  ]
166  );
167  }
168 
173  {
174  $this->actionService->modifyRecords(
175  self::VALUE_PageId,
176  [
177  self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, 'header' => 'Testing #1', self::FIELD_ContentHotel => '3,4'],
178  self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #1'],
179  ]
180  );
181  $this->recordIds['versionedContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
182  $this->recordIds['versionedHotelIdFirst'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 3);
183  $this->recordIds['versionedHotelIdSecond'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 4);
184  $this->actionService->clearWorkspaceRecords(
185  [
186  self::TABLE_Content => [$this->recordIds['versionedContentId']],
187  self::TABLE_Hotel => [$this->recordIds['versionedHotelIdSecond']],
188  ]
189  );
190  $this->actionService->modifyRecords(
191  self::VALUE_PageId,
192  [
193  self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, 'header' => 'Testing #2', self::FIELD_ContentHotel => '3,4'],
194  self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #2'],
195  ]
196  );
197  }
198 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\TABLE_Content
‪const TABLE_Content
Definition: AbstractActionTestCase.php:37
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_WorkspaceId
‪const VALUE_WorkspaceId
Definition: AbstractActionTestCase.php:22
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent
‪createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent()
Definition: AbstractActionTestCase.php:112
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyParentWithHotelChildAndDiscardModifiedParent
‪modifyParentWithHotelChildAndDiscardModifiedParent()
Definition: AbstractActionTestCase.php:132
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyParentWithHotelChildAndDiscardAll
‪modifyParentWithHotelChildAndDiscardAll()
Definition: AbstractActionTestCase.php:148
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase
Definition: AbstractActionTestCase.php:21
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent
‪createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardCreatedParent()
Definition: AbstractActionTestCase.php:92
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\setUp
‪setUp()
Definition: AbstractActionTestCase.php:35
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\changeHotelSortingWithOfferNotWorkspaceAware
‪changeHotelSortingWithOfferNotWorkspaceAware()
Definition: AbstractActionTestCase.php:63
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\$scenarioDataSetDirectory
‪string $scenarioDataSetDirectory
Definition: AbstractActionTestCase.php:26
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\VALUE_ContentIdLast
‪const VALUE_ContentIdLast
Definition: AbstractActionTestCase.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setWorkspaceId
‪setWorkspaceId(int $workspaceId)
Definition: AbstractDataHandlerActionTestCase.php:98
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\$coreExtensionsToLoad
‪array $coreExtensionsToLoad
Definition: AbstractActionTestCase.php:30
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase
Definition: AbstractActionTestCase.php:23
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\modifyAndDiscardAndModifyParentWithHotelChild
‪modifyAndDiscardAndModifyParentWithHotelChild()
Definition: AbstractActionTestCase.php:170
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\deleteParentContentAndDiscardDeletedParent
‪deleteParentContentAndDiscardDeletedParent()
Definition: AbstractActionTestCase.php:49
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase\createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent
‪createAndCopyParentContentWithHotelAndOfferChildrenAndDiscardCopiedParent()
Definition: AbstractActionTestCase.php:72
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField
Definition: AbstractActionTestCase.php:2
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\importScenarioDataSet
‪importScenarioDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:117