‪TYPO3CMS  11.5
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 
21 
26 {
30  public function ‪verifyCleanReferenceIndex(): void
31  {
32  // The test verifies the imported data set has a clean reference index by the check in tearDown()
33  self::assertTrue(true);
34  }
35 
39  public function ‪createParentContent(): void
40  {
41  parent::createParentContent();
42  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
43  $this->assertCSVDataSet(__DIR__ . '/DataSet/createParentContent.csv');
44  }
45 
49  public function ‪modifyParentContent(): void
50  {
51  parent::modifyParentContent();
52  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
53  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentContent.csv');
54  }
55 
59  public function ‪deleteParentContent(): void
60  {
61  parent::deleteParentContent();
62  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
63  $this->assertCSVDataSet(__DIR__ . '/DataSet/deleteParentContent.csv');
64  }
65 
69  public function ‪copyParentContent(): void
70  {
71  parent::copyParentContent();
72  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
73  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyParentContent.csv');
74  }
75 
79  public function ‪copyParentContentToDifferentPage(): void
80  {
81  parent::copyParentContentToDifferentPage();
82  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
83  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyParentContentToDifferentPage.csv');
84  }
85 
90  {
91  // Create translated page first
92  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
93  parent::localizeParentContentWithAllChildren();
94  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
95  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeParentContentWAllChildren.csv');
96  }
97 
101  public function ‪changeParentContentSorting(): void
102  {
103  parent::changeParentContentSorting();
104  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
105  $this->assertCSVDataSet(__DIR__ . '/DataSet/changeParentContentSorting.csv');
106  }
107 
111  public function ‪moveParentContentToDifferentPage(): void
112  {
113  parent::moveParentContentToDifferentPage();
114  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
115  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveParentContentToDifferentPage.csv');
116  }
117 
122  {
123  parent::moveParentContentToDifferentPageTwice();
124  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
125  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveParentContentToDifferentPageTwice.csv');
126  }
127 
132  {
133  parent::moveParentContentToDifferentPageAndChangeSorting();
134  $this->actionService->clearWorkspaceRecords([
135  self::TABLE_Content => [self::VALUE_ContentIdFirst, self::VALUE_ContentIdLast],
136  ]);
137  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveParentContentToDifferentPageNChangeSorting.csv');
138  }
139 
147  public function ‪modifyPage(): void
148  {
149  parent::modifyPage();
150  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
151  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyPage.csv');
152  }
153 
157  public function ‪deletePage(): void
158  {
159  parent::deletePage();
160  $this->actionService->clearWorkspaceRecord(self::TABLE_Page, self::VALUE_PageId);
161  $this->assertCSVDataSet(__DIR__ . '/DataSet/deletePage.csv');
162  }
163 
167  public function ‪copyPage(): void
168  {
169  parent::copyPage();
170  $this->actionService->clearWorkspaceRecords([
171  self::TABLE_Page => [$this->recordIds['newPageId']],
172  ]);
173  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyPage.csv');
174  }
175 
180  {
181  parent::copyPageWithHotelBeforeParentContent();
182  $this->actionService->clearWorkspaceRecords([
183  self::TABLE_Page => [$this->recordIds['newPageId']],
184  ]);
185  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyPageWHotelBeforeParentContent.csv');
186  }
187 
196  {
197  parent::createParentContentWithHotelAndOfferChildren();
198  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
199  $this->assertCSVDataSet(__DIR__ . '/DataSet/createParentContentNHotelNOfferChildren.csv');
200  }
201 
206  {
207  parent::createAndCopyParentContentWithHotelAndOfferChildren();
208  $versionedCopiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, $this->recordIds['copiedContentId']);
209  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $versionedCopiedContentId);
210  $this->assertCSVDataSet(__DIR__ . '/DataSet/createNCopyParentContentNHotelNOfferChildren.csv');
211  }
212 
217  {
218  // Create translated page first
219  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
220  parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
221  // Discard created default language parent
222  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $this->recordIds['newContentId']);
223  $this->assertCSVDataSet(__DIR__ . '/DataSet/createNLocalizeParentContentNHotelNOfferChildren.csv');
224  }
225 
231  {
232  parent::createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent();
233  $this->assertCSVDataSet(__DIR__ . '/DataSet/createNLocParentNHotelNOfferChildrenNDiscardLocParent.csv');
234  }
235 
239  public function ‪modifyOnlyHotelChild(): void
240  {
241  parent::modifyOnlyHotelChild();
242  $this->actionService->clearWorkspaceRecord(self::TABLE_Hotel, 4);
243  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyOnlyHotelChild.csv');
244  }
245 
250  {
251  parent::modifyParentAndChangeHotelChildrenSorting();
252  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
253  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentNChangeHotelChildrenSorting.csv');
254  }
255 
259  public function ‪modifyParentWithHotelChild(): void
260  {
261  parent::modifyParentWithHotelChild();
262  $modifiedContentId = $this->actionService->getDataHandler()->getAutoVersionId(self::TABLE_Content, self::VALUE_ContentIdFirst);
263  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, $modifiedContentId);
264  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentNHotelChild.csv');
265  }
266 
270  public function ‪modifyParentAndAddHotelChild(): void
271  {
272  parent::modifyParentAndAddHotelChild();
273  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdLast);
274  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentNAddHotelChild.csv');
275  }
276 
280  public function ‪modifyParentAndDeleteHotelChild(): void
281  {
282  parent::modifyParentAndDeleteHotelChild();
283  $this->actionService->clearWorkspaceRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
284  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentNDeleteHotelChild.csv');
285  }
286 
291  {
292  parent::modifyAndDiscardAndModifyParentWithHotelChild();
293  $this->actionService->clearWorkspaceRecords([
294  self::TABLE_Content => [self::VALUE_ContentIdFirst],
295  self::TABLE_Hotel => [3, 4],
296  ]);
297  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyNDiscardNModifyParentWHotelChild.csv');
298  }
299 }
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\copyPageWithHotelBeforeParentContent
‪copyPageWithHotelBeforeParentContent()
Definition: ActionTest.php:179
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\modifyOnlyHotelChild
‪modifyOnlyHotelChild()
Definition: ActionTest.php:239
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\copyParentContentToDifferentPage
‪copyParentContentToDifferentPage()
Definition: ActionTest.php:79
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\modifyParentContent
‪modifyParentContent()
Definition: ActionTest.php:49
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\createAndCopyParentContentWithHotelAndOfferChildren
‪createAndCopyParentContentWithHotelAndOfferChildren()
Definition: ActionTest.php:205
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\modifyPage
‪modifyPage()
Definition: ActionTest.php:147
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\copyParentContent
‪copyParentContent()
Definition: ActionTest.php:69
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\changeParentContentSorting
‪changeParentContentSorting()
Definition: ActionTest.php:101
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\moveParentContentToDifferentPageTwice
‪moveParentContentToDifferentPageTwice()
Definition: ActionTest.php:121
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\createAndLocalizeParentContentWithHotelAndOfferChildren
‪createAndLocalizeParentContentWithHotelAndOfferChildren()
Definition: ActionTest.php:216
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\createParentContentWithHotelAndOfferChildren
‪createParentContentWithHotelAndOfferChildren()
Definition: ActionTest.php:195
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\AbstractActionTestCase
Definition: AbstractActionTestCase.php:24
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\createParentContent
‪createParentContent()
Definition: ActionTest.php:39
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest
Definition: ActionTest.php:26
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\moveParentContentToDifferentPage
‪moveParentContentToDifferentPage()
Definition: ActionTest.php:111
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\moveParentContentToDifferentPageAndChangeSorting
‪moveParentContentToDifferentPageAndChangeSorting()
Definition: ActionTest.php:131
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\localizeParentContentWithAllChildren
‪localizeParentContentWithAllChildren()
Definition: ActionTest.php:89
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\modifyParentAndDeleteHotelChild
‪modifyParentAndDeleteHotelChild()
Definition: ActionTest.php:280
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard
Definition: ActionTest.php:18
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\deleteParentContent
‪deleteParentContent()
Definition: ActionTest.php:59
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\modifyAndDiscardAndModifyParentWithHotelChild
‪modifyAndDiscardAndModifyParentWithHotelChild()
Definition: ActionTest.php:290
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\verifyCleanReferenceIndex
‪verifyCleanReferenceIndex()
Definition: ActionTest.php:30
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\modifyParentWithHotelChild
‪modifyParentWithHotelChild()
Definition: ActionTest.php:259
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent
‪createAndLocalizeParentContentWithHotelAndOfferChildrenAndDiscardLocalizedParent()
Definition: ActionTest.php:230
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\modifyParentAndChangeHotelChildrenSorting
‪modifyParentAndChangeHotelChildrenSorting()
Definition: ActionTest.php:249
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\copyPage
‪copyPage()
Definition: ActionTest.php:167
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\deletePage
‪deletePage()
Definition: ActionTest.php:157
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRRE\ForeignField\Discard\ActionTest\modifyParentAndAddHotelChild
‪modifyParentAndAddHotelChild()
Definition: ActionTest.php:270