‪TYPO3CMS  10.4
ActionTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
21 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequestContext;
22 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
23 
28 {
32  protected ‪$assertionDataSetDirectory = 'typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/DataSet/';
33 
37  public function ‪verifyCleanReferenceIndex()
38  {
39  // The test verifies the imported data set has a clean reference index by the check in tearDown()
40  self::assertTrue(true);
41  }
42 
47  public function ‪createContents()
48  {
49  parent::createContents();
50  $this->‪assertAssertionDataSet('createContents');
51 
52  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
53  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
54  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
55  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', 'Testing #2'));
56  }
57 
62  public function ‪createContentForLanguageAll()
63  {
64  // Create translated page first
65  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
66  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
67  parent::createContentForLanguageAll();
68 
69  $this->‪assertAssertionDataSet('createContentForLanguageAll');
70 
71  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
72  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
73  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
74  ->setTable(self::TABLE_Content)->setField('header')->setValues('Language set to all', '[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1'));
75  }
76 
81  public function ‪modifyContent()
82  {
83  parent::modifyContent();
84  $this->‪assertAssertionDataSet('modifyContent');
85 
86  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
87  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
88  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
89  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
90  }
91 
96  public function ‪deleteContent()
97  {
98  parent::deleteContent();
99  $this->‪assertAssertionDataSet('deleteContent');
100 
101  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
102  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
103  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
104  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
105  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
106  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
107  }
108 
114  {
115  // Create translated page first
116  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
117 
118  parent::deleteLocalizedContentAndDeleteContent();
119  $this->‪assertAssertionDataSet('deleteLocalizedContentNDeleteContent');
120 
121  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
122  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
123  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
124  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #3', '[Translate to Dansk:] Regular Element #3', 'Regular Element #1'));
125  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
126  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', 'Regular Element #2'));
127  }
128 
133  public function ‪copyContent()
134  {
135  parent::copyContent();
136  $this->‪assertAssertionDataSet('copyContent');
137 
138  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
139  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
140  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
141  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2 (copy 1)'));
142  }
143 
148  public function ‪copyContentToLanguage()
149  {
150  // Create translated page first
151  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
152  parent::copyContentToLanguage();
153  $this->‪assertAssertionDataSet('copyContentToLanguage');
154 
155  // Set up "dk" to not have overlays
156  $languageConfiguration = ‪$this->siteLanguageConfiguration;
157  $languageConfiguration[‪self::VALUE_LanguageId]['fallbackType'] = 'free';
158  $this->‪setUpFrontendSite(1, $languageConfiguration);
159  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
160  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
161  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
162  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2'));
163  }
164 
170  {
171  // Create translated page first
172  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
173  parent::copyContentToLanguageWithLanguageSynchronization();
174  $this->‪assertAssertionDataSet('copyContentToLanguageWSynchronization');
175 
176  // Set up "dk" to not have overlays
177  $languageConfiguration = ‪$this->siteLanguageConfiguration;
178  $languageConfiguration[‪self::VALUE_LanguageId]['fallbackType'] = 'free';
179  $this->‪setUpFrontendSite(1, $languageConfiguration);
180  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
181  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
182  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
183  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2'));
184  }
185 
191  {
192  // Create translated page first
193  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
194  parent::copyContentToLanguageWithLocalizationExclude();
195  $this->‪assertAssertionDataSet('copyContentToLanguageWExclude');
196 
197  // Set up "dk" to not have overlays
198  $languageConfiguration = ‪$this->siteLanguageConfiguration;
199  $languageConfiguration[‪self::VALUE_LanguageId]['fallbackType'] = 'free';
200  $this->‪setUpFrontendSite(1, $languageConfiguration);
201  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
202  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
203  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
204  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #3', 'Regular Element #2 (copy 1)'));
205  }
206 
212  {
213  // Create translated page first
214  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
215  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
216  parent::copyContentToLanguageFromNonDefaultLanguage();
217  $this->‪assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage');
218 
219  // Set up "de" to not have overlays
220  $languageConfiguration = ‪$this->siteLanguageConfiguration;
221  $languageConfiguration[‪self::VALUE_LanguageIdSecond]['fallbackType'] = 'free';
222  $this->‪setUpFrontendSite(1, $languageConfiguration);
223  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
224  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
225  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
226  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
227  }
228 
233  public function ‪copyPasteContent()
234  {
235  parent::copyPasteContent();
236  $this->‪assertAssertionDataSet('copyPasteContent');
237 
238  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
239  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
240  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
241  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
242  }
243 
248  public function ‪localizeContent()
249  {
250  // Create translated page first
251  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
252  parent::localizeContent();
253  $this->‪assertAssertionDataSet('localizeContent');
254 
255  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
256  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
257  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
258  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
259  }
260 
267  {
268  parent::localizeContentWithEmptyTcaIntegrityColumns();
269  $this->‪assertAssertionDataSet('localizeContentWithEmptyTcaIntegrityColumns');
270 
271  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
272  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
273  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
274  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
275  }
276 
282  {
283  // Create translated page first
284  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
285  parent::localizeContentWithLanguageSynchronization();
286  $this->‪assertAssertionDataSet('localizeContentWSynchronization');
287 
288  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
289  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
290  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
291  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', 'Testing #1'));
292  }
293 
299  {
300  // Create translated page first
301  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
302  parent::localizeContentWithLanguageSynchronizationHavingNullValue();
303  $this->‪assertAssertionDataSet('localizeContentWSynchronizationHNull');
304 
305  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
306  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
307  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
308  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', 'Testing #1'));
309  }
310 
316  {
317  // Create translated page first
318  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
319  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
320  parent::localizeContentFromNonDefaultLanguage();
321 
322  $this->‪assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
323 
324  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
325  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
326  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
327  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1', '[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
328  }
329 
335  {
336  // Create translated page first
337  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
338  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
339  parent::localizeContentFromNonDefaultLanguageWithLanguageSynchronizationDefault();
340 
341  $this->‪assertAssertionDataSet('localizeContentFromNonDefaultLanguageWSynchronizationDefault');
342 
343  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
344  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
345  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
346  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1', 'Testing #1'));
347  }
348 
354  {
355  // Create translated page first
356  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
357  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
358  parent::localizeContentFromNonDefaultLanguageWithLanguageSynchronizationSource();
359 
360  $this->‪assertAssertionDataSet('localizeContentFromNonDefaultLanguageWSynchronizationSource');
361 
362  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
363  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
364  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
365  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #1', 'Testing #1'));
366  }
367 
371  public function ‪localizeContentAfterMovedContent()
372  {
373  $this->‪importScenarioDataSet('LivePageFreeModeElements');
374  parent::localizeContentAfterMovedContent();
375  $this->‪assertAssertionDataSet('localizeContentAfterMovedContent');
376  }
377 
382  public function ‪createLocalizedContent()
383  {
384  // Create translated page first
385  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
386  parent::createLocalizedContent();
387 
388  $this->‪assertAssertionDataSet('createLocalizedContent');
389 
390  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
391  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
392  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
393  ->setTable(self::TABLE_Content)->setField('header')->setValues('Localized Testing'));
394  }
395 
401  {
402  // Create translated page first
403  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
404  parent::createLocalizedContentWithLanguageSynchronization();
405 
406  $this->‪assertAssertionDataSet('createLocalizedContentWSynchronization');
407 
408  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
409  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
410  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
411  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing'));
412  }
413 
419  {
420  // Create translated page first
421  $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
422  parent::createLocalizedContentWithLocalizationExclude();
423 
424  $this->‪assertAssertionDataSet('createLocalizedContentWExclude');
425 
426  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
427  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
428  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
429  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing', '[Translate to Dansk:] Regular Element #1', 'Regular Element #2'));
430  }
431 
436  public function ‪changeContentSorting()
437  {
438  parent::changeContentSorting();
439  $this->‪assertAssertionDataSet('changeContentSorting');
440 
441  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
442  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
443  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
444  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
445  }
446 
451  public function ‪changeContentSortingAfterSelf()
452  {
453  parent::changeContentSortingAfterSelf();
454  $this->‪assertAssertionDataSet('changeContentSortingAfterSelf');
455 
456  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
457  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
458  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
459  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
460  }
461 
466  public function ‪moveContentToDifferentPage()
467  {
468  parent::moveContentToDifferentPage();
469  $this->‪assertAssertionDataSet('moveContentToDifferentPage');
470 
471  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
472  $responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
473  self::assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
474  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
475  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
476  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
477  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionHasRecordConstraint()
478  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
479  }
480 
485  public function ‪movePasteContentToDifferentPage()
486  {
487  parent::movePasteContentToDifferentPage();
488  $this->‪assertAssertionDataSet('movePasteContentToDifferentPage');
489 
490  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
491  $responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
492  self::assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
493  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
494  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
495  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
496  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionHasRecordConstraint()
497  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
498  }
499 
505  {
506  parent::moveContentToDifferentPageAndChangeSorting();
507  $this->‪assertAssertionDataSet('moveContentToDifferentPageNChangeSorting');
508 
509  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
510  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
511  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
512  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
513  }
514 
523  public function ‪createPage()
524  {
525  parent::createPage();
526  $this->‪assertAssertionDataSet('createPage');
527 
528  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
529  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
530  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
531  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
532  }
533 
538  {
539  parent::createPageAndSubPageAndSubPageContent();
540  $this->‪assertAssertionDataSet('createPageAndSubPageAndSubPageContent');
541 
542  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newSubPageId']));
543  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
544  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
545  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1 #1'));
546  }
547 
552  public function ‪createPageWithSlugOverrideConfiguration(): void
553  {
554  // set default configuration
555  ‪$GLOBALS['TCA']['pages']['columns']['slug']['config']['generatorOptions'] = [
556  'fields' => [
557  'title',
558  ],
559  'fieldSeparator' => '-',
560  'prefixParentPageSlug' => true,
561  ];
562  // set override for doktype default
563  ‪$GLOBALS['TCA']['pages']['types'][‪PageRepository::DOKTYPE_DEFAULT]['columnsOverrides'] = [
564  'slug' => [
565  'config' => [
566  'generatorOptions' => [
567  'fields' => [
568  'nav_title'
569  ],
570  'fieldSeparator' => '-',
571  'prefixParentPageSlug' => true,
572  ]
573  ]
574  ]
575  ];
576  parent::createPage();
577  $this->‪assertAssertionDataSet('createPageWithSlugOverrideConfiguration');
578  }
579 
585  {
586  parent::createPageAndContentWithTcaDefaults();
587  $this->‪assertAssertionDataSet('createPageNContentWDefaults');
588 
589  // first, assert that page cannot be opened without using backend user (since it's hidden)
590  $response = $this->executeFrontendRequest(
591  (new InternalRequest())
592  ->withPageId($this->recordIds['newPageId'])
593  );
594  self::assertSame(404, $response->getStatusCode());
595 
596  // then, assert if preview is possible using a backend user
597  $response = $this->executeFrontendRequest(
598  (new InternalRequest())
599  ->withPageId($this->recordIds['newPageId']),
600  (new InternalRequestContext())
601  ->withBackendUserId(self::VALUE_BackendUserId)
602  );
603  $responseSections = ResponseContent::fromString((string)$response->getBody())
604  ->getSections();
605  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
606  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
607  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
608  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
609  }
610 
615  public function ‪modifyPage()
616  {
617  parent::modifyPage();
618  $this->‪assertAssertionDataSet('modifyPage');
619 
620  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
621  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
622  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
623  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
624  }
625 
630  public function ‪deletePage()
631  {
632  parent::deletePage();
633  $this->‪assertAssertionDataSet('deletePage');
634 
635  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
636  self::assertEquals(404, $response->getStatusCode());
637  }
638 
643  public function ‪copyPage()
644  {
645  parent::copyPage();
646  $this->‪assertAssertionDataSet('copyPage');
647 
648  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
649  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
650  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
651  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
652  }
653 
663  public function ‪copyPageFreeMode()
664  {
665  $this->‪importScenarioDataSet('LivePageFreeModeElements');
666  parent::copyPageFreeMode();
667  $this->‪assertAssertionDataSet('copyPageFreeMode');
668 
669  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
670  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
671  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
672  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target'));
673  }
674 
679  public function ‪localizePage()
680  {
681  parent::localizePage();
682  $this->‪assertAssertionDataSet('localizePage');
683 
684  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
685  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
686  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
687  ->setTable(self::TABLE_Page)->setField('title')->setValues('[Translate to Dansk:] Relations'));
688  }
689 
694  public function ‪localizeAndCopyPage()
695  {
696  parent::localizePage();
697  parent::copyPage();
698  $this->‪assertAssertionDataSet('localizeNCopyPage');
699 
700  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId'])->withLanguageId(self::VALUE_LanguageId));
701  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
702  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
703  ->setTable(self::TABLE_Page)->setField('title')->setValues('[Translate to Dansk:] Relations'));
704  }
705 
711  {
712  parent::localizePageWithLanguageSynchronization();
713  $this->‪assertAssertionDataSet('localizePageWSynchronization');
714 
715  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
716  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
717  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
718  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
719  }
720 
726  {
727  parent::localizePageWithLanguageSynchronization();
728  parent::copyPage();
729  $this->‪assertAssertionDataSet('localizeNCopyPageWSynchronization');
730 
731  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
732  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
733  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
734  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
735  }
736 
741  {
742  // Create localized page and localize content elements first
743  parent::localizePageAndContentsAndDeletePageLocalization();
744  $this->‪assertAssertionDataSet('localizePageAndContentsAndDeletePageLocalization');
745  }
746 
750  public function ‪localizeNestedPagesAndContents()
751  {
752  parent::localizeNestedPagesAndContents();
753  $this->‪assertAssertionDataSet('localizeNestedPagesAndContents');
754  }
755 
760  public function ‪changePageSorting()
761  {
762  parent::changePageSorting();
763  $this->‪assertAssertionDataSet('changePageSorting');
764 
765  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
766  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
767  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
768  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
769  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
770  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
771  }
772 
777  public function ‪changePageSortingAfterSelf()
778  {
779  parent::changePageSortingAfterSelf();
780  $this->‪assertAssertionDataSet('changePageSortingAfterSelf');
781 
782  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
783  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
784  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
785  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
786  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
787  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
788  }
789 
794  public function ‪movePageToDifferentPage()
795  {
796  parent::movePageToDifferentPage();
797  $this->‪assertAssertionDataSet('movePageToDifferentPage');
798 
799  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
800  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
801  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
802  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
803  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
804  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
805  }
806 
810  public function ‪movePageToDifferentPageTwice()
811  {
812  parent::movePageToDifferentPageTwice();
813  $this->‪assertAssertionDataSet('movePageToDifferentPageTwice');
814  }
815 
820  {
821  parent::movePageLocalizedToDifferentPageTwice();
822  $this->‪assertAssertionDataSet('movePageLocalizedToDifferentPageTwice');
823  }
824 
830  {
831  parent::movePageToDifferentPageAndChangeSorting();
832  $this->‪assertAssertionDataSet('movePageToDifferentPageNChangeSorting');
833 
834  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
835  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
836  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
837  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
838  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
839  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
840  }
841 }
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageToDifferentPageTwice
‪movePageToDifferentPageTwice()
Definition: ActionTest.php:809
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changeContentSorting
‪changeContentSorting()
Definition: ActionTest.php:435
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizePageAndContentsAndDeletePageLocalization
‪localizePageAndContentsAndDeletePageLocalization()
Definition: ActionTest.php:739
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setUpFrontendSite
‪setUpFrontendSite(int $pageId, array $additionalLanguages=[])
Definition: AbstractDataHandlerActionTestCase.php:143
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionHasRecordConstraint
‪HasRecordConstraint getRequestSectionHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:289
‪TYPO3\CMS\Core\Domain\Repository\PageRepository\DOKTYPE_DEFAULT
‪const DOKTYPE_DEFAULT
Definition: PageRepository.php:103
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyContentToLanguageWithLocalizationExclude
‪copyContentToLanguageWithLocalizationExclude()
Definition: ActionTest.php:189
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createContents
‪createContents()
Definition: ActionTest.php:46
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\verifyCleanReferenceIndex
‪verifyCleanReferenceIndex()
Definition: ActionTest.php:36
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentFromNonDefaultLanguageWithLanguageSynchronizationSource
‪localizeContentFromNonDefaultLanguageWithLanguageSynchronizationSource()
Definition: ActionTest.php:352
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\moveContentToDifferentPageAndChangeSorting
‪moveContentToDifferentPageAndChangeSorting()
Definition: ActionTest.php:503
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageToDifferentPageAndChangeSorting
‪movePageToDifferentPageAndChangeSorting()
Definition: ActionTest.php:828
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase\VALUE_LanguageId
‪const VALUE_LanguageId
Definition: AbstractActionTestCase.php:39
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\$assertionDataSetDirectory
‪string $assertionDataSetDirectory
Definition: ActionTest.php:31
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContent
‪localizeContent()
Definition: ActionTest.php:247
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPage
‪createPage()
Definition: ActionTest.php:522
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeNestedPagesAndContents
‪localizeNestedPagesAndContents()
Definition: ActionTest.php:749
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPageAndContentWithTcaDefaults
‪createPageAndContentWithTcaDefaults()
Definition: ActionTest.php:583
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createLocalizedContentWithLocalizationExclude
‪createLocalizedContentWithLocalizationExclude()
Definition: ActionTest.php:417
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizePage
‪localizePage()
Definition: ActionTest.php:678
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentWithEmptyTcaIntegrityColumns
‪localizeContentWithEmptyTcaIntegrityColumns()
Definition: ActionTest.php:265
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest
Definition: ActionTest.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase\VALUE_LanguageIdSecond
‪const VALUE_LanguageIdSecond
Definition: AbstractActionTestCase.php:40
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changeContentSortingAfterSelf
‪changeContentSortingAfterSelf()
Definition: ActionTest.php:450
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\modifyPage
‪modifyPage()
Definition: ActionTest.php:614
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\moveContentToDifferentPage
‪moveContentToDifferentPage()
Definition: ActionTest.php:465
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentWithLanguageSynchronization
‪localizeContentWithLanguageSynchronization()
Definition: ActionTest.php:280
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\deleteLocalizedContentAndDeleteContent
‪deleteLocalizedContentAndDeleteContent()
Definition: ActionTest.php:112
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePasteContentToDifferentPage
‪movePasteContentToDifferentPage()
Definition: ActionTest.php:484
‪TYPO3\CMS\Frontend\Page\PageRepository
Definition: LegacyClassesForIde.php:22
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizePageWithLanguageSynchronization
‪localizePageWithLanguageSynchronization()
Definition: ActionTest.php:709
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentFromNonDefaultLanguage
‪localizeContentFromNonDefaultLanguage()
Definition: ActionTest.php:314
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changePageSorting
‪changePageSorting()
Definition: ActionTest.php:759
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyContentToLanguageFromNonDefaultLanguage
‪copyContentToLanguageFromNonDefaultLanguage()
Definition: ActionTest.php:210
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageToDifferentPage
‪movePageToDifferentPage()
Definition: ActionTest.php:793
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\changePageSortingAfterSelf
‪changePageSortingAfterSelf()
Definition: ActionTest.php:776
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createContentForLanguageAll
‪createContentForLanguageAll()
Definition: ActionTest.php:61
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeAndCopyPageWithLanguageSynchronization
‪localizeAndCopyPageWithLanguageSynchronization()
Definition: ActionTest.php:724
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase
Definition: AbstractActionTestCase.php:28
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\assertAssertionDataSet
‪assertAssertionDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:208
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyPage
‪copyPage()
Definition: ActionTest.php:642
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionDoesNotHaveRecordConstraint
‪DoesNotHaveRecordConstraint getRequestSectionDoesNotHaveRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:297
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\deleteContent
‪deleteContent()
Definition: ActionTest.php:95
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyContentToLanguageWithLanguageSynchronization
‪copyContentToLanguageWithLanguageSynchronization()
Definition: ActionTest.php:168
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyPageFreeMode
‪copyPageFreeMode()
Definition: ActionTest.php:662
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyPasteContent
‪copyPasteContent()
Definition: ActionTest.php:232
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPageWithSlugOverrideConfiguration
‪createPageWithSlugOverrideConfiguration()
Definition: ActionTest.php:551
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyContentToLanguage
‪copyContentToLanguage()
Definition: ActionTest.php:147
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createPageAndSubPageAndSubPageContent
‪createPageAndSubPageAndSubPageContent()
Definition: ActionTest.php:536
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\$siteLanguageConfiguration
‪array $siteLanguageConfiguration
Definition: AbstractDataHandlerActionTestCase.php:86
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\modifyContent
‪modifyContent()
Definition: ActionTest.php:80
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentWithLanguageSynchronizationHavingNullValue
‪localizeContentWithLanguageSynchronizationHavingNullValue()
Definition: ActionTest.php:297
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\copyContent
‪copyContent()
Definition: ActionTest.php:132
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeAndCopyPage
‪localizeAndCopyPage()
Definition: ActionTest.php:693
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentFromNonDefaultLanguageWithLanguageSynchronizationDefault
‪localizeContentFromNonDefaultLanguageWithLanguageSynchronizationDefault()
Definition: ActionTest.php:333
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify
Definition: ActionTest.php:16
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\localizeContentAfterMovedContent
‪localizeContentAfterMovedContent()
Definition: ActionTest.php:370
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createLocalizedContent
‪createLocalizedContent()
Definition: ActionTest.php:381
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\movePageLocalizedToDifferentPageTwice
‪movePageLocalizedToDifferentPageTwice()
Definition: ActionTest.php:818
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\importScenarioDataSet
‪importScenarioDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:201
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\createLocalizedContentWithLanguageSynchronization
‪createLocalizedContentWithLanguageSynchronization()
Definition: ActionTest.php:399
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Modify\ActionTest\deletePage
‪deletePage()
Definition: ActionTest.php:629