‪TYPO3CMS  ‪main
AbstractActionWorkspacesTestCase.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 
21 {
22  protected const ‪VALUE_WorkspaceId = 1;
23 
24  protected const ‪SCENARIO_DataSet = __DIR__ . '/DataSet/ImportDefaultWorkspaces.csv';
25 
26  protected array ‪$coreExtensionsToLoad = ['workspaces'];
27 
29  {
30  $newTableIds = $this->actionService->createNewRecords(
31  self::VALUE_PageId,
32  [
33  self::TABLE_Content => ['header' => 'Testing #1', self::FIELD_ContentHotel => '__nextUid'],
34  self::TABLE_Hotel => ['title' => 'Hotel #1', self::FIELD_HotelOffer => '__nextUid'],
35  self::TABLE_Offer => ['title' => 'Offer #1'],
36  ]
37  );
38  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
39  $localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['newContentId'], self::VALUE_LanguageId);
40  $this->recordIds['localizedContentId'] = $localizedTableIds[‪self::TABLE_Content][$this->recordIds['newContentId']];
41  $versionedLocalizedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds['localizedContentId']);
42  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedLocalizedContentId);
43  }
44 
46  {
47  $this->actionService->modifyRecords(
48  self::VALUE_PageId,
49  [
50  self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, 'header' => 'Testing #1', self::FIELD_ContentHotel => '3,4'],
51  self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #1'],
52  ]
53  );
54  $this->recordIds['versionedContentId'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
55  $this->recordIds['versionedHotelIdFirst'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 3);
56  $this->recordIds['versionedHotelIdSecond'] = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Hotel, 4);
57  $this->actionService->clearWorkspaceRecords(
58  [
59  self::TABLE_Content => [$this->recordIds['versionedContentId']],
60  ]
61  );
62  $this->actionService->modifyRecords(
63  self::VALUE_PageId,
64  [
65  self::TABLE_Content => ['uid' => self::VALUE_ContentIdFirst, 'header' => 'Testing #2', self::FIELD_ContentHotel => '3,4'],
66  self::TABLE_Hotel => ['uid' => 4, 'title' => 'Testing #2'],
67  ]
68  );
69  }
70 }
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreForeignFieldNonWs
Definition: AbstractActionTestCase.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreForeignFieldNonWs\AbstractActionWorkspacesTestCase
Definition: AbstractActionWorkspacesTestCase.php:21
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreForeignFieldNonWs\AbstractActionTestCase
Definition: AbstractActionTestCase.php:25
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreForeignFieldNonWs\AbstractActionWorkspacesTestCase\VALUE_WorkspaceId
‪const VALUE_WorkspaceId
Definition: AbstractActionWorkspacesTestCase.php:22
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreForeignFieldNonWs\AbstractActionWorkspacesTestCase\modifyAndDiscardAndModifyParentWithHotelChild
‪modifyAndDiscardAndModifyParentWithHotelChild()
Definition: AbstractActionWorkspacesTestCase.php:45
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreForeignFieldNonWs\AbstractActionWorkspacesTestCase\$coreExtensionsToLoad
‪array $coreExtensionsToLoad
Definition: AbstractActionWorkspacesTestCase.php:26
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreForeignFieldNonWs\AbstractActionTestCase\TABLE_Content
‪const TABLE_Content
Definition: AbstractActionTestCase.php:40
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreForeignFieldNonWs\AbstractActionWorkspacesTestCase\createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent
‪createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent()
Definition: AbstractActionWorkspacesTestCase.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreForeignFieldNonWs\AbstractActionWorkspacesTestCase\SCENARIO_DataSet
‪const SCENARIO_DataSet
Definition: AbstractActionWorkspacesTestCase.php:24