‪TYPO3CMS  11.5
AbstractActionTestCase.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
24 {
25  protected const ‪VALUE_WorkspaceId = 1;
26 
27  protected const ‪SCENARIO_DataSet = __DIR__ . '/DataSet/ImportDefault.csv';
28 
29  protected ‪$coreExtensionsToLoad = ['workspaces'];
30 
32  {
33  ‪$GLOBALS['TCA']['tx_testirrecsv_offer']['ctrl']['versioningWS'] = false;
34  $this->actionService->moveRecord(self::TABLE_Hotel, self::VALUE_HotelIdFirst, -self::VALUE_HotelIdSecond);
35  }
36 
38  {
39  $newTableIds = $this->actionService->createNewRecords(
40  self::VALUE_PageId,
41  [
42  self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
43  self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
44  self::TABLE_Offer => ['title' => 'Offer #1'],
45  ]
46  );
47  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
48  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
49  $this->recordIds['localizedContentId'] = $localizedTableIds[‪self::TABLE_Content][$this->recordIds['newContentId']];
50  $versionedLocalizedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds['localizedContentId']);
51  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedLocalizedContentId);
52  }
53 
55  {
56  $this->actionService->modifyRecords(
57  self::VALUE_PageId,
58  [
59  self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, 'header' => 'Testing #1', self::FIELD_ContentHotel => '3,4'],
60  self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #1'],
61  ]
62  );
63  $this->recordIds['versionedContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
64  $this->recordIds['versionedHotelIdFirst'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 3);
65  $this->recordIds['versionedHotelIdSecond'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 4);
66  $this->actionService->clearWorkspaceRecords(
67  [
68  self::TABLE_Content => [$this->recordIds['versionedContentId']],
69  ]
70  );
71  $this->actionService->modifyRecords(
72  self::VALUE_PageId,
73  [
74  self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, 'header' => 'Testing #2', self::FIELD_ContentHotel => '3,4'],
75  self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #2'],
76  ]
77  );
78  }
79 
81  {
82  unset(‪$GLOBALS['TCA'][self::TABLE_Content]['ctrl']['delete']);
83  unset(‪$GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['delete']);
84  unset(‪$GLOBALS['TCA'][self::TABLE_Offer]['ctrl']['delete']);
85  unset(‪$GLOBALS['TCA'][self::TABLE_Price]['ctrl']['delete']);
86  $newRecordIds = $this->actionService->moveRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_PageIdTarget);
87  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $newRecordIds[self::TABLE_Content][self::VALUE_ContentIdLast]);
88  }
89 }
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV
Definition: AbstractActionTestCase.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase\TABLE_Content
‪const TABLE_Content
Definition: AbstractActionTestCase.php:39
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase\$coreExtensionsToLoad
‪$coreExtensionsToLoad
Definition: AbstractActionTestCase.php:29
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase\changeHotelSortingWithOfferNotWorkspaceAware
‪changeHotelSortingWithOfferNotWorkspaceAware()
Definition: AbstractActionTestCase.php:31
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase\createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent
‪createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent()
Definition: AbstractActionTestCase.php:37
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase\modifyAndDiscardAndModifyParentWithHotelChild
‪modifyAndDiscardAndModifyParentWithHotelChild()
Definition: AbstractActionTestCase.php:54
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase
Definition: AbstractActionTestCase.php:26
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase\VALUE_WorkspaceId
‪const VALUE_WorkspaceId
Definition: AbstractActionTestCase.php:25
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase
Definition: AbstractActionTestCase.php:24
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase\moveParentContentToDifferentPageAndDiscardWithoutSoftDelete
‪moveParentContentToDifferentPageAndDiscardWithoutSoftDelete()
Definition: AbstractActionTestCase.php:80
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\CSV\AbstractActionTestCase\SCENARIO_DataSet
‪const SCENARIO_DataSet
Definition: AbstractActionTestCase.php:27