‪TYPO3CMS  ‪main
ActionTest.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 
20 use PHPUnit\Framework\Attributes\Test;
22 
24 {
25  #[Test]
26  public function ‪verifyCleanReferenceIndex(): void
27  {
28  // The test verifies the imported data set has a clean reference index by the check in tearDown()
29  self::assertTrue(true);
30  }
31 
32  #[Test]
33  public function ‪addElementRelation(): void
34  {
35  parent::addElementRelation();
36  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
37  $this->assertCSVDataSet(__DIR__ . '/DataSet/addElementRelation.csv');
38  }
39 
40  #[Test]
41  public function ‪deleteElementRelation(): void
42  {
43  parent::deleteElementRelation();
44  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
45  $this->assertCSVDataSet(__DIR__ . '/DataSet/deleteElementRelation.csv');
46  }
47 
48  #[Test]
49  public function ‪changeElementSorting(): void
50  {
51  parent::changeElementSorting();
52  $this->actionService->clearWorkspaceRecord(self::TABLE_Element, self::VALUE_ElementIdFirst);
53  $this->assertCSVDataSet(__DIR__ . '/DataSet/changeElementSorting.csv');
54  }
55 
56  #[Test]
57  public function ‪changeElementRelationSorting(): void
58  {
59  parent::changeElementRelationSorting();
60  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
61  $this->assertCSVDataSet(__DIR__ . '/DataSet/changeElementRelationSorting.csv');
62  }
63 
64  #[Test]
65  public function ‪createContentAndAddElementRelation(): void
66  {
67  parent::createContentAndAddElementRelation();
68  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
69  $this->assertCSVDataSet(__DIR__ . '/DataSet/createContentNAddRelation.csv');
70  }
71 
72  #[Test]
74  {
76  $this->actionService->clearWorkspaceRecord(self::TABLE_Element, $this->recordIds['newElementId']);
77  $this->assertCSVDataSet(__DIR__ . '/DataSet/createContentNCreateRelationNDiscardElement.csv');
78  }
79 
80  #[Test]
82  {
84  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
85  $this->assertCSVDataSet(__DIR__ . '/DataSet/createContentNCreateRelationNDiscardContent.csv');
86  }
87 
88  #[Test]
89  public function ‪modifyElementOfRelation(): void
90  {
91  parent::modifyElementOfRelation();
92  $this->actionService->clearWorkspaceRecord(self::TABLE_Element, self::VALUE_ElementIdFirst);
93  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyElementOfRelation.csv');
94  }
95 
96  #[Test]
97  public function ‪modifyContentOfRelation(): void
98  {
99  parent::modifyContentOfRelation();
100  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
101  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyContentOfRelation.csv');
102  }
103 
104  #[Test]
105  public function ‪modifyBothSidesOfRelation(): void
106  {
107  parent::modifyBothSidesOfRelation();
108  $this->actionService->clearWorkspaceRecords([
109  self::TABLE_Content => [self::VALUE_ContentIdFirst],
110  self::TABLE_Element => [self::VALUE_ElementIdFirst],
111  ]);
112  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyBothSidesOfRelation.csv');
113  }
114 
115  #[Test]
116  public function ‪deleteContentOfRelation(): void
117  {
118  parent::deleteContentOfRelation();
119  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
120  $this->assertCSVDataSet(__DIR__ . '/DataSet/deleteContentOfRelation.csv');
121  }
122 
123  #[Test]
124  public function ‪deleteElementOfRelation(): void
125  {
126  parent::deleteElementOfRelation();
127  $this->actionService->clearWorkspaceRecord(self::TABLE_Element, self::VALUE_ElementIdFirst);
128  $this->assertCSVDataSet(__DIR__ . '/DataSet/deleteElementOfRelation.csv');
129  }
130 
131  #[Test]
132  public function ‪copyContentOfRelation(): void
133  {
134  parent::copyContentOfRelation();
135  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['copiedContentId']);
136  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyContentOfRelation.csv');
137  }
138 
139  #[Test]
140  public function ‪copyElementOfRelation(): void
141  {
142  parent::copyElementOfRelation();
143  $this->actionService->clearWorkspaceRecord(self::TABLE_Element, $this->recordIds['copiedElementId']);
144  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyElementOfRelation.csv');
145  }
146 
147  #[Test]
148  public function ‪localizeContentOfRelation(): void
149  {
150  parent::localizeContentOfRelation();
151  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
152  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelation.csv');
153  }
154 
155  #[Test]
156  public function ‪localizeElementOfRelation(): void
157  {
158  // Create translated page first
159  $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId);
160  parent::localizeElementOfRelation();
161  $this->actionService->clearWorkspaceRecord(self::TABLE_Element, $this->recordIds['localizedElementId']);
162  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeElementOfRelation.csv');
163  }
164 
165  #[Test]
167  {
168  parent::moveContentOfRelationToDifferentPage();
169  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['movedContentId']);
170  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveContentOfRelationToDifferentPage.csv');
171  }
172 
173  #[Test]
175  {
176  parent::localizeContentOfRelationWithLocalizeReferencesAtParentLocalization();
177  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
178  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeContentOfRelationWLocalizeReferencesAtParentLocalization.csv');
179  }
180 }
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\AbstractActionWorkspacesTestCase
Definition: AbstractActionWorkspacesTestCase.php:21
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\deleteContentOfRelation
‪deleteContentOfRelation()
Definition: ActionTest.php:116
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\copyElementOfRelation
‪copyElementOfRelation()
Definition: ActionTest.php:140
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\createContentAndAddElementRelation
‪createContentAndAddElementRelation()
Definition: ActionTest.php:65
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\createContentAndCreateElementRelationAndDiscardElement
‪createContentAndCreateElementRelationAndDiscardElement()
Definition: ActionTest.php:73
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest
Definition: ActionTest.php:24
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\verifyCleanReferenceIndex
‪verifyCleanReferenceIndex()
Definition: ActionTest.php:26
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\modifyBothSidesOfRelation
‪modifyBothSidesOfRelation()
Definition: ActionTest.php:105
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\moveContentOfRelationToDifferentPage
‪moveContentOfRelationToDifferentPage()
Definition: ActionTest.php:166
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\localizeContentOfRelation
‪localizeContentOfRelation()
Definition: ActionTest.php:148
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\AbstractActionTestCase\createContentAndCreateElementRelation
‪createContentAndCreateElementRelation()
Definition: AbstractActionTestCase.php:112
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\deleteElementOfRelation
‪deleteElementOfRelation()
Definition: ActionTest.php:124
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\addElementRelation
‪addElementRelation()
Definition: ActionTest.php:33
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\changeElementSorting
‪changeElementSorting()
Definition: ActionTest.php:49
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\copyContentOfRelation
‪copyContentOfRelation()
Definition: ActionTest.php:132
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\modifyContentOfRelation
‪modifyContentOfRelation()
Definition: ActionTest.php:97
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\modifyElementOfRelation
‪modifyElementOfRelation()
Definition: ActionTest.php:89
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\deleteElementRelation
‪deleteElementRelation()
Definition: ActionTest.php:41
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard
Definition: ActionTest.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\localizeContentOfRelationWithLocalizeReferencesAtParentLocalization
‪localizeContentOfRelationWithLocalizeReferencesAtParentLocalization()
Definition: ActionTest.php:174
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\changeElementRelationSorting
‪changeElementRelationSorting()
Definition: ActionTest.php:57
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\localizeElementOfRelation
‪localizeElementOfRelation()
Definition: ActionTest.php:156
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\Group\WorkspacesDiscard\ActionTest\createContentAndCreateElementRelationAndDiscardContent
‪createContentAndCreateElementRelationAndDiscardContent()
Definition: ActionTest.php:81