‪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 {
24 
28  protected ‪$scenarioDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/DataSet/';
29 
33  protected ‪$coreExtensionsToLoad = [
34  'fluid',
35  'workspaces',
36  ];
37 
38  protected function ‪setUp()
39  {
40  parent::setUp();
41  $this->‪importScenarioDataSet('ReferenceIndex');
42  $this->‪setWorkspaceId(self::VALUE_WorkspaceId);
43  }
44 
52  public function ‪createContentAndAddRelation()
53  {
54  $newTableIds = $this->actionService->createNewRecord(
55  self::TABLE_Content,
56  self::VALUE_PageId,
57  ['header' => 'Testing #1', 'categories' => self::VALUE_CategoryIdSecond]
58  );
59  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
60  }
61 
65  public function ‪createCategoryAndAddRelation()
66  {
67  $newTableIds = $this->actionService->createNewRecord(
68  self::TABLE_Category,
69  0,
70  ['title' => 'Testing #1', 'items' => 'tt_content_' . self::VALUE_ContentIdFirst]
71  );
72  $this->recordIds['newCategoryId'] = $newTableIds[‪self::TABLE_Category][0];
73  }
74 
78  public function ‪createContentAndCreateRelation()
79  {
80  $newTableIds = $this->actionService->createNewRecords(
81  self::VALUE_PageId,
82  [
83  self::TABLE_Category => ['pid' => 0, 'title' => 'Testing #1'],
84  self::TABLE_Content => ['header' => 'Testing #1', 'categories' => '__previousUid'],
85  ]
86  );
87  $this->recordIds['newCategoryId'] = $newTableIds[‪self::TABLE_Category][0];
88  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
89  }
90 
94  public function ‪createCategoryAndCreateRelation()
95  {
96  $newTableIds = $this->actionService->createNewRecords(
97  self::VALUE_PageId,
98  [
99  self::TABLE_Content => ['header' => 'Testing #1'],
100  self::TABLE_Category => ['pid' => 0, 'title' => 'Testing #1', 'items' => 'tt_content___previousUid'],
101  ]
102  );
103  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
104  $this->recordIds['newCategoryId'] = $newTableIds[‪self::TABLE_Category][0];
105  }
106 
108  {
109  $newTableIds = $this->actionService->createNewRecords(
110  self::VALUE_PageId,
111  [
112  self::TABLE_Category => ['pid' => 0, 'title' => 'Testing #1'],
113  self::TABLE_Content => ['header' => 'Testing #1'],
114  ]
115  );
116  $this->recordIds['newCategoryId'] = $newTableIds[‪self::TABLE_Category][0];
117  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
118 
119  $this->actionService->modifyRecord(
120  self::TABLE_Content,
121  $this->recordIds['newContentId'],
122  ['categories' => $this->recordIds['newCategoryId']]
123  );
124  }
125 
127  {
128  $newTableIds = $this->actionService->createNewRecords(
129  self::VALUE_PageId,
130  [
131  self::TABLE_Content => ['header' => 'Testing #1'],
132  self::TABLE_Category => ['pid' => 0, 'title' => 'Testing #1', 'items' => 'tt_content___previousUid'],
133  ]
134  );
135  $this->recordIds['newContentId'] = $newTableIds[‪self::TABLE_Content][0];
136  $this->recordIds['newCategoryId'] = $newTableIds[‪self::TABLE_Category][0];
137 
138  $this->actionService->modifyRecord(
139  self::TABLE_Category,
140  $this->recordIds['newCategoryId'],
141  ['items' => 'tt_content_' . $this->recordIds['newContentId']]
142  );
143  }
144 }
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\VALUE_CategoryIdLast
‪const VALUE_CategoryIdLast
Definition: AbstractActionTestCase.php:22
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\createContentAndAddRelation
‪createContentAndAddRelation()
Definition: AbstractActionTestCase.php:50
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\createContentWithCategoryAndAddRelation
‪createContentWithCategoryAndAddRelation()
Definition: AbstractActionTestCase.php:105
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\setUp
‪setUp()
Definition: AbstractActionTestCase.php:36
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\TABLE_Content
‪const TABLE_Content
Definition: AbstractActionTestCase.php:34
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\createCategoryWithContentAndAddRelation
‪createCategoryWithContentAndAddRelation()
Definition: AbstractActionTestCase.php:124
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\VALUE_WorkspaceId
‪const VALUE_WorkspaceId
Definition: AbstractActionTestCase.php:23
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\$scenarioDataSetDirectory
‪string $scenarioDataSetDirectory
Definition: AbstractActionTestCase.php:27
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setWorkspaceId
‪setWorkspaceId(int $workspaceId)
Definition: AbstractDataHandlerActionTestCase.php:98
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase
Definition: AbstractActionTestCase.php:21
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\createContentAndCreateRelation
‪createContentAndCreateRelation()
Definition: AbstractActionTestCase.php:76
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\createCategoryAndAddRelation
‪createCategoryAndAddRelation()
Definition: AbstractActionTestCase.php:63
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\$coreExtensionsToLoad
‪array $coreExtensionsToLoad
Definition: AbstractActionTestCase.php:31
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\TABLE_Category
‪const TABLE_Category
Definition: AbstractActionTestCase.php:35
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase\createCategoryAndCreateRelation
‪createCategoryAndCreateRelation()
Definition: AbstractActionTestCase.php:92
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\ManyToMany
Definition: AbstractActionTestCase.php:2
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\importScenarioDataSet
‪importScenarioDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:117
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\ManyToMany\AbstractActionTestCase
Definition: AbstractActionTestCase.php:21