‪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 use TYPO3\TestingFramework\Core\Functional\Framework\Constraint\RequestSection\DoesNotHaveRecordConstraint;
23 use TYPO3\TestingFramework\Core\Functional\Framework\Constraint\RequestSection\HasRecordConstraint;
24 use TYPO3\TestingFramework\Core\Functional\Framework\Constraint\RequestSection\StructureDoesNotHaveRecordConstraint;
25 use TYPO3\TestingFramework\Core\Functional\Framework\Constraint\RequestSection\StructureHasRecordConstraint;
26 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
27 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
28 
30 {
31  #[Test]
32  public function ‪verifyCleanReferenceIndex(): void
33  {
34  // The test verifies the imported data set has a clean reference index by the check in tearDown()
35  self::assertTrue(true);
36  }
37 
38  #[Test]
39  public function ‪createParentContent(): void
40  {
41  parent::createParentContent();
42  $this->assertCSVDataSet(__DIR__ . '/DataSet/createParentContent.csv');
43 
44  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
45  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
46  self::assertThat($responseSections, (new HasRecordConstraint())
47  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
48  }
49 
50  #[Test]
51  public function ‪modifyParentContent(): void
52  {
53  parent::modifyParentContent();
54  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentContent.csv');
55 
56  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
57  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
58  self::assertThat($responseSections, (new HasRecordConstraint())
59  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
60  self::assertThat($responseSections, (new StructureHasRecordConstraint())
61  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
62  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
63  }
64 
65  #[Test]
66  public function ‪deleteParentContent(): void
67  {
68  parent::deleteParentContent();
69  $this->assertCSVDataSet(__DIR__ . '/DataSet/deleteParentContent.csv');
70 
71  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
72  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
73  self::assertThat($responseSections, (new DoesNotHaveRecordConstraint())
74  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
75  }
76 
77  #[Test]
78  public function ‪copyParentContent(): void
79  {
80  parent::copyParentContent();
81  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyParentContent.csv');
82 
83  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
84  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
85  self::assertThat($responseSections, (new StructureHasRecordConstraint())
86  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
87  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
88  }
89 
90  #[Test]
91  public function ‪copyParentContentToDifferentPage(): void
92  {
93  parent::copyParentContentToDifferentPage();
94  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyParentContentToDifferentPage.csv');
95 
96  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
97  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
98  self::assertThat($responseSections, (new StructureHasRecordConstraint())
99  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
100  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
101  }
102 
103  #[Test]
105  {
106  parent::copyParentContentToLanguageWithAllChildren();
107  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyParentContentToLanguageWithAllChildren.csv');
108 
109  // Set up "danish" to not have overlays - "free" mode
111  'test',
112  $this->‪buildSiteConfiguration(1, '/'),
113  [
114  $this->‪buildDefaultLanguageConfiguration('EN', '/'),
115  $this->‪buildLanguageConfiguration('DA', '/da/', [], 'free'),
116  $this->‪buildLanguageConfiguration('DE', '/de/', ['DA', 'EN']),
117  ]
118  );
119 
120  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
121  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections('Default');
122  self::assertThat($responseSections, (new StructureHasRecordConstraint())
123  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentHotel)
124  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
125  }
126 
127  #[Test]
129  {
130  // Create translated page first
131  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
132 
133  parent::localizeParentContentWithAllChildren();
134  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeParentContentWAllChildren.csv');
135 
136  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
137  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
138  self::assertThat($responseSections, (new StructureHasRecordConstraint())
139  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
140  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
141  }
142 
143  #[Test]
145  {
146  // Create translated page first
147  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
148 
149  parent::localizeParentContentWithLanguageSynchronization();
150  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeParentContentLanguageSynchronization.csv');
151 
152  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
153  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
154  self::assertThat($responseSections, (new StructureHasRecordConstraint())
155  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
156  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1', '[Translate to Dansk:] Hotel #2'));
157  }
158 
159  #[Test]
160  public function ‪changeParentContentSorting(): void
161  {
162  parent::changeParentContentSorting();
163  $this->assertCSVDataSet(__DIR__ . '/DataSet/changeParentContentSorting.csv');
164 
165  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
166  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
167  self::assertThat($responseSections, (new StructureHasRecordConstraint())
168  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
169  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
170  self::assertThat($responseSections, (new StructureHasRecordConstraint())
171  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
172  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
173  }
174 
175  #[Test]
176  public function ‪moveParentContentToDifferentPage(): void
177  {
178  parent::moveParentContentToDifferentPage();
179  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveParentContentToDifferentPage.csv');
180 
181  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
182  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
183  self::assertThat($responseSections, (new HasRecordConstraint())
184  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
185  self::assertThat($responseSections, (new StructureHasRecordConstraint())
186  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
187  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
188  }
189 
190  #[Test]
192  {
193  parent::moveParentContentToDifferentPageAndChangeSorting();
194  $this->assertCSVDataSet(__DIR__ . '/DataSet/moveParentContentToDifferentPageNChangeSorting.csv');
195 
196  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
197  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
198  self::assertThat($responseSections, (new HasRecordConstraint())
199  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2', 'Regular Element #1'));
200  self::assertThat($responseSections, (new StructureHasRecordConstraint())
201  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
202  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
203  self::assertThat($responseSections, (new StructureHasRecordConstraint())
204  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
205  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
206  }
207 
208  #[Test]
209  public function ‪modifyPage(): void
210  {
211  parent::modifyPage();
212  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyPage.csv');
213 
214  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
215  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
216  self::assertThat($responseSections, (new HasRecordConstraint())
217  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
218  }
219 
220  #[Test]
221  public function ‪deletePage(): void
222  {
223  parent::deletePage();
224  $this->assertCSVDataSet(__DIR__ . '/DataSet/deletePage.csv');
225 
226  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
227  self::assertEquals(404, $response->getStatusCode());
228  }
229 
230  #[Test]
231  public function ‪copyPage(): void
232  {
233  parent::copyPage();
234  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyPage.csv');
235 
236  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
237  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
238  self::assertThat($responseSections, (new HasRecordConstraint())
239  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
240  }
241 
242  #[Test]
244  {
245  parent::copyPageWithHotelBeforeParentContent();
246  $this->assertCSVDataSet(__DIR__ . '/DataSet/copyPageWHotelBeforeParentContent.csv');
247 
248  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
249  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
250  self::assertThat($responseSections, (new HasRecordConstraint())
251  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2', 'Hotel #1'));
252  }
253 
254  #[Test]
256  {
257  parent::createParentContentWithHotelAndOfferChildren();
258  $this->assertCSVDataSet(__DIR__ . '/DataSet/createParentContentNHotelNOfferChildren.csv');
259 
260  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
261  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
262  self::assertThat($responseSections, (new HasRecordConstraint())
263  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
264  self::assertThat($responseSections, (new StructureHasRecordConstraint())
265  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
266  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
267  }
268 
269  #[Test]
271  {
272  parent::createAndCopyParentContentWithHotelAndOfferChildren();
273  $this->assertCSVDataSet(__DIR__ . '/DataSet/createNCopyParentContentNHotelNOfferChildren.csv');
274 
275  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
276  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
277  self::assertThat($responseSections, (new StructureHasRecordConstraint())
278  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
279  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
280  self::assertThat($responseSections, (new StructureHasRecordConstraint())
281  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['copiedContentId'])->setRecordField(self::FIELD_ContentHotel)
282  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
283  self::assertThat($responseSections, (new StructureHasRecordConstraint())
284  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['copiedHotelId'])->setRecordField(self::FIELD_HotelOffer)
285  ->setTable(self::TABLE_Offer)->setField('title')->setValues('Offer #1'));
286  }
287 
288  #[Test]
290  {
291  // Create translated page first
292  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
293 
294  parent::createAndLocalizeParentContentWithHotelAndOfferChildren();
295  $this->assertCSVDataSet(__DIR__ . '/DataSet/createNLocalizeParentContentNHotelNOfferChildren.csv');
296 
297  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
298  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
299  // Content record gets overlaid, thus using newContentId
300  self::assertThat($responseSections, (new StructureHasRecordConstraint())
301  ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['newContentId'])->setRecordField(self::FIELD_ContentHotel)
302  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
303  // Content record directly points to localized child, thus using localizedHotelId
304  self::assertThat($responseSections, (new StructureHasRecordConstraint())
305  ->setRecordIdentifier(self::TABLE_Hotel . ':' . $this->recordIds['localizedHotelId'])->setRecordField(self::FIELD_HotelOffer)
306  ->setTable(self::TABLE_Offer)->setField('title')->setValues('[Translate to Dansk:] Offer #1'));
307  }
308 
309  #[Test]
310  public function ‪modifyOnlyHotelChild(): void
311  {
312  parent::modifyOnlyHotelChild();
313  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyOnlyHotelChild.csv');
314 
315  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
316  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
317  self::assertThat($responseSections, (new StructureHasRecordConstraint())
318  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
319  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
320  }
321 
322  #[Test]
324  {
325  parent::modifyParentAndChangeHotelChildrenSorting();
326  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentNChangeHotelChildrenSorting.csv');
327 
328  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
329  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
330  self::assertThat($responseSections, (new StructureHasRecordConstraint())
331  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
332  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2', 'Hotel #1'));
333  }
334 
335  #[Test]
336  public function ‪modifyParentWithHotelChild(): void
337  {
338  parent::modifyParentWithHotelChild();
339  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentNHotelChild.csv');
340 
341  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
342  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
343  self::assertThat($responseSections, (new StructureHasRecordConstraint())
344  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentHotel)
345  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Testing #1'));
346  }
347 
348  #[Test]
349  public function ‪modifyParentAndAddHotelChild(): void
350  {
351  parent::modifyParentAndAddHotelChild();
352  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentNAddHotelChild.csv');
353 
354  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
355  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
356  self::assertThat($responseSections, (new StructureHasRecordConstraint())
357  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
358  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1', 'Hotel #2'));
359  }
360 
361  #[Test]
362  public function ‪modifyParentAndDeleteHotelChild(): void
363  {
364  parent::modifyParentAndDeleteHotelChild();
365  $this->assertCSVDataSet(__DIR__ . '/DataSet/modifyParentNDeleteHotelChild.csv');
366 
367  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
368  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
369  self::assertThat($responseSections, (new StructureHasRecordConstraint())
370  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
371  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
372  self::assertThat($responseSections, (new StructureDoesNotHaveRecordConstraint())
373  ->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
374  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #2'));
375  }
376 
377  #[Test]
379  {
380  parent::localizePageWithLocalizationExclude();
381  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageWExclude.csv');
382 
383  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
384  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
385  self::assertThat($responseSections, (new StructureHasRecordConstraint())
386  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
387  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0'));
388  }
389 
390  #[Test]
392  {
393  parent::localizePageTwiceWithLocalizationExclude();
394  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageTwiceWExclude.csv');
395 
396  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
397  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
398  self::assertThat($responseSections, (new StructureHasRecordConstraint())
399  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
400  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0'));
401  }
402 
403  #[Test]
405  {
406  parent::localizePageAndAddHotelChildWithLocalizationExclude();
407  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageNAddHotelChildWExclude.csv');
408 
409  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
410  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
411  self::assertThat($responseSections, (new StructureHasRecordConstraint())
412  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
413  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0', 'Hotel #007'));
414  }
415 
416  #[Test]
418  {
419  parent::localizePageWithLanguageSynchronization();
420  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageWSynchronization.csv');
421 
422  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
423  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
424  self::assertThat($responseSections, (new StructureHasRecordConstraint())
425  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
426  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #0'));
427  }
428 
429  #[Test]
431  {
432  parent::localizePageAndAddHotelChildWithLanguageSynchronization();
433  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageNAddHotelChildWSynchronization.csv');
434 
435  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
436  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
437  self::assertThat($responseSections, (new StructureHasRecordConstraint())
438  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
439  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #0', '[Translate to Dansk:] Hotel #007'));
440  }
441 
442  #[Test]
444  {
445  parent::localizePageAndAddMonoglotHotelChildWithLanguageSynchronization();
446  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageNAddMonoglotHotelChildWSynchronization.csv');
447 
448  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
449  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
450  self::assertThat($responseSections, (new StructureHasRecordConstraint())
451  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
452  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0', 'Hotel #007'));
453  }
454 
455  #[Test]
457  {
458  parent::localizeAndCopyPageWithLanguageSynchronization();
459  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizeNCopyPageWSynchronization.csv');
460 
461  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
462  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
463  self::assertThat($responseSections, (new StructureHasRecordConstraint())
464  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
465  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #0'));
466  }
467 
472  #[Test]
474  {
475  parent::localizePageWithSynchronizationAndCustomLocalizedHotel();
476  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageWithSynchronizationAndCustomLocalizedHotel.csv');
477 
478  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
479  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
480  self::assertThat($responseSections, (new StructureHasRecordConstraint())
481  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
482  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #0'));
483  }
484 
485  #[Test]
487  {
488  parent::localizePageAndAddMonoglotHotelChildWithLanguageSynchronization();
489  parent::copyPage();
490  $this->assertCSVDataSet(__DIR__ . '/DataSet/localizePageAddMonoglotHotelChildNCopyPageWSynchronization.csv');
491 
492  $response = $this->executeFrontendSubRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
493  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
494  self::assertThat($responseSections, (new StructureHasRecordConstraint())
495  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageId)->setRecordField(self::FIELD_PageHotel)
496  ->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #0', 'Hotel #007'));
497  }
498 }
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizePageTwiceWithLocalizationExclude
‪localizePageTwiceWithLocalizationExclude()
Definition: ActionTest.php:391
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildLanguageConfiguration
‪buildLanguageConfiguration(string $identifier, string $base, array $fallbackIdentifiers=[], string $fallbackType=null)
Definition: SiteBasedTestTrait.php:108
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizePageWithLocalizationExclude
‪localizePageWithLocalizationExclude()
Definition: ActionTest.php:378
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\copyPageWithHotelBeforeParentContent
‪copyPageWithHotelBeforeParentContent()
Definition: ActionTest.php:243
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\moveParentContentToDifferentPage
‪moveParentContentToDifferentPage()
Definition: ActionTest.php:176
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizeParentContentWithAllChildren
‪localizeParentContentWithAllChildren()
Definition: ActionTest.php:128
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\changeParentContentSorting
‪changeParentContentSorting()
Definition: ActionTest.php:160
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\copyPage
‪copyPage()
Definition: ActionTest.php:231
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\modifyParentContent
‪modifyParentContent()
Definition: ActionTest.php:51
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\writeSiteConfiguration
‪writeSiteConfiguration(string $identifier, array $site=[], array $languages=[], array $errorHandling=[])
Definition: SiteBasedTestTrait.php:50
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest
Definition: ActionTest.php:30
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify
Definition: ActionTest.php:18
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\modifyParentAndChangeHotelChildrenSorting
‪modifyParentAndChangeHotelChildrenSorting()
Definition: ActionTest.php:323
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\deleteParentContent
‪deleteParentContent()
Definition: ActionTest.php:66
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildSiteConfiguration
‪buildSiteConfiguration(int $rootPageId, string $base='')
Definition: SiteBasedTestTrait.php:88
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizePageAddMonoglotHotelChildAndCopyPageWithLanguageSynchronization
‪localizePageAddMonoglotHotelChildAndCopyPageWithLanguageSynchronization()
Definition: ActionTest.php:486
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizePageAndAddHotelChildWithLanguageSynchronization
‪localizePageAndAddHotelChildWithLanguageSynchronization()
Definition: ActionTest.php:430
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\verifyCleanReferenceIndex
‪verifyCleanReferenceIndex()
Definition: ActionTest.php:32
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\moveParentContentToDifferentPageAndChangeSorting
‪moveParentContentToDifferentPageAndChangeSorting()
Definition: ActionTest.php:191
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\copyParentContentToDifferentPage
‪copyParentContentToDifferentPage()
Definition: ActionTest.php:91
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizeAndCopyPageWithLanguageSynchronization
‪localizeAndCopyPageWithLanguageSynchronization()
Definition: ActionTest.php:456
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\createParentContent
‪createParentContent()
Definition: ActionTest.php:39
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\modifyOnlyHotelChild
‪modifyOnlyHotelChild()
Definition: ActionTest.php:310
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\modifyPage
‪modifyPage()
Definition: ActionTest.php:209
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\createAndCopyParentContentWithHotelAndOfferChildren
‪createAndCopyParentContentWithHotelAndOfferChildren()
Definition: ActionTest.php:270
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\copyParentContent
‪copyParentContent()
Definition: ActionTest.php:78
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\modifyParentWithHotelChild
‪modifyParentWithHotelChild()
Definition: ActionTest.php:336
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizePageWithLanguageSynchronization
‪localizePageWithLanguageSynchronization()
Definition: ActionTest.php:417
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\AbstractActionTestCase
Definition: AbstractActionTestCase.php:24
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildDefaultLanguageConfiguration
‪buildDefaultLanguageConfiguration(string $identifier, string $base)
Definition: SiteBasedTestTrait.php:98
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizePageWithSynchronizationAndCustomLocalizedHotel
‪localizePageWithSynchronizationAndCustomLocalizedHotel()
Definition: ActionTest.php:473
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\createAndLocalizeParentContentWithHotelAndOfferChildren
‪createAndLocalizeParentContentWithHotelAndOfferChildren()
Definition: ActionTest.php:289
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizePageAndAddMonoglotHotelChildWithLanguageSynchronization
‪localizePageAndAddMonoglotHotelChildWithLanguageSynchronization()
Definition: ActionTest.php:443
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizePageAndAddHotelChildWithLocalizationExclude
‪localizePageAndAddHotelChildWithLocalizationExclude()
Definition: ActionTest.php:404
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\copyParentContentToLanguageWithAllChildren
‪copyParentContentToLanguageWithAllChildren()
Definition: ActionTest.php:104
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\createParentContentWithHotelAndOfferChildren
‪createParentContentWithHotelAndOfferChildren()
Definition: ActionTest.php:255
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\modifyParentAndAddHotelChild
‪modifyParentAndAddHotelChild()
Definition: ActionTest.php:349
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\localizeParentContentWithLanguageSynchronization
‪localizeParentContentWithLanguageSynchronization()
Definition: ActionTest.php:144
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\modifyParentAndDeleteHotelChild
‪modifyParentAndDeleteHotelChild()
Definition: ActionTest.php:362
‪TYPO3\CMS\Core\Tests\Functional\DataScenarios\IrreCsv\Modify\ActionTest\deletePage
‪deletePage()
Definition: ActionTest.php:221