‪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 
19 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
20 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequestContext;
21 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
22 
27 {
31  protected ‪$assertionDataSetDirectory = 'typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/DataSet/';
32 
36  protected ‪$assertCleanReferenceIndex = false;
37 
42  public function ‪createContents()
43  {
44  parent::createContents();
45  $this->actionService->publishRecords(
46  [
47  self::TABLE_Content => [$this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']],
48  ]
49  );
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 
61  public function ‪createContentAndCopyContent()
62  {
63  parent::createContentAndCopyContent();
64  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']);
65  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId']);
66  $this->‪assertAssertionDataSet('createContentAndCopyContent');
67 
68  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
69  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
70  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
71  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1', 'Testing #1 (copy 1)'));
72  }
73 
78  public function ‪modifyContent()
79  {
80  parent::modifyContent();
81  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
82  $this->‪assertAssertionDataSet('modifyContent');
83 
84  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
85  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
86  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
87  ->setTable(self::TABLE_Content)->setField('header')->setValues('Testing #1'));
88  }
89 
93  public function ‪hideContent()
94  {
95  parent::hideContent();
96  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
97  $this->‪assertAssertionDataSet('hideContent');
98 
99  $response = $this->executeFrontendRequest(
100  (new InternalRequest())->withPageId(self::VALUE_PageId),
101  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)
102  );
103  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
104  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
105  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
106  }
107 
111  public function ‪hideContentAndMoveToDifferentPage()
112  {
113  parent::hideContent();
114  parent::moveContentToDifferentPage();
115  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
116  $this->‪assertAssertionDataSet('hideContentAndMoveToDifferentPage');
117 
118  $response = $this->executeFrontendRequest(
119  (new InternalRequest())->withPageId(self::VALUE_PageId),
120  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)
121  );
122  $responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
123  self::assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
124  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
125  self::assertThat($responseSectionsSource, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
126  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
127  $response = $this->executeFrontendRequest(
128  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget),
129  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)
130  );
131  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
132  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionHasRecordConstraint()
133  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
134  }
135 
139  public function ‪deleteContent()
140  {
141  parent::deleteContent();
142  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
143  $this->‪assertAssertionDataSet('deleteContent');
144 
145  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
146  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
147  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
148  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
149  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
150  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
151  }
152 
157  {
158  // this test will not rely on a translated page, because it only tests the act of publishing.
159  // The actual content of frontend response does not matter much, and it would increase the scope
160  // of the test, when a translated page is also published here.
161  parent::deleteLocalizedContentAndDeleteContent();
162  $this->actionService->publishRecords(
163  [
164  self::TABLE_Content => [self::VALUE_ContentIdThird, self::VALUE_ContentIdThirdLocalized],
165  ]
166  );
167  $this->‪assertAssertionDataSet('deleteLocalizedContentNDeleteContent');
168 
169  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
170  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
171  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
172  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #3', '[Translate to Dansk:] Regular Element #3'));
173  }
174 
178  public function ‪copyContent()
179  {
180  parent::copyContent();
181  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['copiedContentId']);
182  $this->‪assertAssertionDataSet('copyContent');
183 
184  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
185  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
186  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
187  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2 (copy 1)'));
188  }
189 
193  public function ‪copyContentToLanguage()
194  {
195  // Create and publish translated page first
196  $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
197  $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
198  parent::copyContentToLanguage();
199  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
200  $this->‪assertAssertionDataSet('copyContentToLanguage');
201 
202  // Set up "dk" to not have overlays
203  $languageConfiguration = ‪$this->siteLanguageConfiguration;
204  $languageConfiguration[‪self::VALUE_LanguageId]['fallbackType'] = 'free';
205  $this->‪setUpFrontendSite(1, $languageConfiguration);
206  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
207  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
208  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
209  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2'));
210  }
211 
216  {
217  // Create and publish translated page first
218  $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
219  $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
220  parent::copyContentToLanguageFromNonDefaultLanguage();
221  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
222  $this->‪assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage');
223 
224  // Set up "dk" to not have overlays
225  $languageConfiguration = ‪$this->siteLanguageConfiguration;
226  $languageConfiguration[‪self::VALUE_LanguageIdSecond]['fallbackType'] = 'free';
227  $this->‪setUpFrontendSite(1, $languageConfiguration);
228  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
229  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
230  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
231  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3'));
232  }
233 
237  public function ‪localizeContent()
238  {
239  // Create and publish translated page first
240  $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
241  $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
242  parent::localizeContent();
243  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
244  $this->‪assertAssertionDataSet('localizeContent');
245 
246  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
247  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
248  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
249  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #2'));
250  }
251 
255  public function ‪localizeContentAfterMovedContent()
256  {
257  parent::localizeContentAfterMovedContent();
258  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
259  $this->‪assertAssertionDataSet('localizeContentAfterMovedContent');
260  }
261 
266  {
267  parent::localizeContentAfterMovedInLiveContent();
268  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
269  $this->‪assertAssertionDataSet('localizeContentAfterMovedInLiveContent');
270  }
271 
276  {
277  // Create and publish translated page first
278  $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
279  $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]);
280  parent::localizeContentFromNonDefaultLanguage();
281  $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']);
282  $this->‪assertAssertionDataSet('localizeContentFromNonDefaultLanguage');
283 
284  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageIdSecond));
285  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
286  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
287  ->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'));
288  }
289 
293  public function ‪changeContentSorting()
294  {
295  parent::changeContentSorting();
296  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
297  $this->‪assertAssertionDataSet('changeContentSorting');
298 
299  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
300  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
301  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
302  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
303  }
304 
308  public function ‪changeContentSortingAfterSelf()
309  {
310  parent::changeContentSortingAfterSelf();
311  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
312  $this->‪assertAssertionDataSet('changeContentSortingAfterSelf');
313 
314  $response = $this->executeFrontendRequest(
315  (new InternalRequest())->withPageId(self::VALUE_PageId),
316  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
317  );
318  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
319  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
320  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
321  }
322 
326  public function ‪moveContentToDifferentPage()
327  {
328  parent::moveContentToDifferentPage();
329  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
330  $this->‪assertAssertionDataSet('moveContentToDifferentPage');
331 
332  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
333  $responseSectionsSource = ResponseContent::fromString((string)$response->getBody())->getSections();
334  self::assertThat($responseSectionsSource, $this->‪getRequestSectionHasRecordConstraint()
335  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
336  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
337  $responseSectionsTarget = ResponseContent::fromString((string)$response->getBody())->getSections();
338  self::assertThat($responseSectionsTarget, $this->‪getRequestSectionHasRecordConstraint()
339  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
340  }
341 
346  {
347  parent::moveContentToDifferentPageAndChangeSorting();
348  $this->actionService->publishRecords([
349  self::TABLE_Content => [self::VALUE_ContentIdFirst, self::VALUE_ContentIdSecond],
350  ]);
351  $this->‪assertAssertionDataSet('moveContentToDifferentPageNChangeSorting');
352 
353  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdTarget));
354  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
355  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
356  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
357  }
358 
362  public function ‪moveContentToDifferentPageAndHide()
363  {
364  parent::moveContentToDifferentPageAndHide();
365  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdSecond);
366  $this->‪assertAssertionDataSet('moveContentToDifferentPageAndHide');
367 
368  $response = $this->executeFrontendRequest(
369  (new InternalRequest())->withPageId(self::VALUE_PageIdTarget),
370  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
371  );
372  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
373  self::assertThat($responseSections, $this->‪getRequestSectionDoesNotHaveRecordConstraint()
374  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
375  }
376 
384  public function ‪createPage()
385  {
386  parent::createPage();
387  $this->actionService->publishRecord(self::TABLE_Page, $this->recordIds['newPageId']);
388  $this->‪assertAssertionDataSet('createPage');
389 
390  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
391  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
392  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
393  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
394  }
395 
400  {
401  parent::createPageAndSubPageAndSubPageContent();
402  $this->actionService->publishRecord(self::TABLE_Page, $this->recordIds['newPageId']);
403  $this->‪assertAssertionDataSet('createPageAndSubPageAndSubPageContent');
404 
405  // Sub page is not published together with parent page
406  $response = $this->executeFrontendRequest(
407  (new InternalRequest())->withPageId($this->recordIds['newSubPageId']),
408  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
409  );
410  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
411  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
412  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1 #1'));
413  }
414 
418  public function ‪modifyPage()
419  {
420  parent::modifyPage();
421  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
422  $this->‪assertAssertionDataSet('modifyPage');
423 
424  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
425  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
426  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
427  ->setTable(self::TABLE_Page)->setField('title')->setValues('Testing #1'));
428  }
429 
433  public function ‪deletePage()
434  {
435  parent::deletePage();
436  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
437  $this->‪assertAssertionDataSet('deletePage');
438 
439  $response = $this->executeFrontendRequest(
440  (new InternalRequest())->withPageId(self::VALUE_PageId)
441  );
442  self::assertEquals(404, $response->getStatusCode());
443  }
444 
448  public function ‪deleteContentAndPage()
449  {
450  parent::deleteContentAndPage();
451  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
452  $this->‪assertAssertionDataSet('deleteContentAndPage');
453 
454  $response = $this->executeFrontendRequest(
455  (new InternalRequest())->withPageId(self::VALUE_PageId)
456  );
457  self::assertEquals(404, $response->getStatusCode());
458  }
459 
463  public function ‪localizeNestedPagesAndContents()
464  {
465  parent::localizeNestedPagesAndContents();
466  // Will publish only the page translation, not it's content elements
467  $this->actionService->publishRecord(self::TABLE_Page, $this->recordIds['localizedParentPageId']);
468  $this->‪assertAssertionDataSet('localizeNestedPagesAndContents');
469  }
470 
474  public function ‪copyPage()
475  {
476  parent::copyPage();
477  $this->actionService->publishRecords(
478  [
479  self::TABLE_Page => [$this->recordIds['newPageId']],
480  self::TABLE_Content => [$this->recordIds['newContentIdFirst'], $this->recordIds['newContentIdLast']],
481  ]
482  );
483  $this->‪assertAssertionDataSet('copyPage');
484 
485  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
486  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
487  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
488  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
489  }
490 
494  public function ‪copyPageFreeMode()
495  {
496  parent::copyPageFreeMode();
497  $this->actionService->publishRecords(
498  [
499  self::TABLE_Page => [$this->recordIds['newPageId']],
500  self::TABLE_Content => [$this->recordIds['newContentIdTenth'], $this->recordIds['newContentIdTenthLocalized'], $this->recordIds['newContentIdTenthLocalized2']],
501  ]
502  );
503  $this->‪assertAssertionDataSet('copyPageFreeMode');
504 
505  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId($this->recordIds['newPageId']));
506  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
507  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
508  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target'));
509  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
510  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #10'));
511  }
512 
516  public function ‪localizePage()
517  {
518  parent::localizePage();
519  $this->actionService->publishRecord(self::TABLE_Page, $this->recordIds['localizedPageId']);
520  $this->‪assertAssertionDataSet('localizePage');
521 
522  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId));
523  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
524  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
525  ->setTable(self::TABLE_Page)->setField('title')->setValues('[Translate to Dansk:] Relations'));
526  }
527 
531  public function ‪createPageAndChangePageSorting()
532  {
533  parent::createPageAndChangePageSorting();
534  $this->actionService->publishRecord(self::TABLE_Page, $this->recordIds['newPageId']);
535  $this->‪assertAssertionDataSet('createPageAndChangePageSorting');
536  }
537 
541  public function ‪createPageAndMoveCreatedPage()
542  {
543  parent::createPageAndMoveCreatedPage();
544  $this->actionService->publishRecord(self::TABLE_Page, $this->recordIds['newPageId']);
545  $this->‪assertAssertionDataSet('createPageAndMoveCreatedPage');
546  }
547 
551  public function ‪changePageSorting()
552  {
553  parent::changePageSorting();
554  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
555  $this->‪assertAssertionDataSet('changePageSorting');
556 
557  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
558  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
559  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
560  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
561  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
562  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
563  }
564 
568  public function ‪changePageSortingAfterSelf()
569  {
570  parent::changePageSortingAfterSelf();
571  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
572  $this->‪assertAssertionDataSet('changePageSortingAfterSelf');
573 
574  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
575  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
576  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
577  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
578  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
579  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
580  }
581 
585  public function ‪movePageToDifferentPage()
586  {
587  parent::movePageToDifferentPage();
588  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
589  $this->‪assertAssertionDataSet('movePageToDifferentPage');
590 
591  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
592  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
593  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
594  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
595  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
596  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
597  }
598 
602  public function ‪movePageToDifferentPageTwice()
603  {
604  parent::movePageToDifferentPageTwice();
605  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
606  $this->‪assertAssertionDataSet('movePageToDifferentPageTwice');
607  }
608 
613  {
614  parent::movePageLocalizedToDifferentPageTwice();
615  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
616  $this->‪assertAssertionDataSet('movePageLocalizedToDifferentPageTwice');
617  }
618 
623  {
624  parent::movePageLocalizedInLiveToDifferentPageTwice();
625  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
626  $this->‪assertAssertionDataSet('movePageLocalizedInLiveToDifferentPageTwice');
627  }
628 
633  {
634  parent::movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice();
635  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
636  $this->‪assertAssertionDataSet('movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice');
637  }
638 
643  {
644  parent::movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice();
645  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_PageId);
646  $this->‪assertAssertionDataSet('movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice');
647  }
648 
653  {
654  parent::movePageToDifferentPageAndChangeSorting();
655  $this->actionService->publishRecords([
656  self::TABLE_Page => [self::VALUE_PageId, self::VALUE_PageIdTarget],
657  ]);
658  $this->‪assertAssertionDataSet('movePageToDifferentPageNChangeSorting');
659 
660  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageId));
661  $responseSectionsPage = ResponseContent::fromString((string)$response->getBody())->getSections();
662  self::assertThat($responseSectionsPage, $this->‪getRequestSectionHasRecordConstraint()
663  ->setTable(self::TABLE_Page)->setField('title')->setValues('Relations'));
664  self::assertThat($responseSectionsPage, $this->‪getRequestSectionHasRecordConstraint()
665  ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1', 'Regular Element #2'));
666  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdWebsite));
667  $responseSectionsWebsite = ResponseContent::fromString((string)$response->getBody())->getSections();
668  self::assertThat($responseSectionsWebsite, $this->‪getRequestSectionStructureHasRecordConstraint()
669  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
670  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Relations', 'DataHandlerTest'));
671  }
672 
679  {
680  parent::movePageToDifferentPageAndCreatePageAfterMovedPage();
681  $this->actionService->publishRecords([
682  self::TABLE_Page => [self::VALUE_PageIdTarget, $this->recordIds['newPageId']],
683  ]);
684  $this->‪assertAssertionDataSet('movePageToDifferentPageNCreatePageAfterMovedPage');
685 
686  $response = $this->executeFrontendRequest((new InternalRequest())->withPageId(self::VALUE_PageIdWebsite));
687  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
688  self::assertThat($responseSections, $this->‪getRequestSectionStructureHasRecordConstraint()
689  ->setRecordIdentifier(self::TABLE_Page . ':' . self::VALUE_PageIdWebsite)->setRecordField('__pages')
690  ->setTable(self::TABLE_Page)->setField('title')->setValues('Target', 'Testing #1', 'DataHandlerTest'));
691  }
692 
697  {
698  parent::changeContentSortingAndCopyDraftPage();
699  $this->actionService->publishRecord(self::TABLE_Content, self::VALUE_ContentIdFirst);
700  $this->‪assertAssertionDataSet('changeContentSortingAndCopyDraftPage');
701  }
702 
706  public function ‪createContentAndCopyDraftPage()
707  {
708  parent::createContentAndCopyDraftPage();
709  $this->actionService->publishRecords([
710  self::TABLE_Content => [$this->recordIds['newContentId']],
711  self::TABLE_Page => [$this->recordIds['copiedPageId']]
712  ]);
713  $this->‪assertAssertionDataSet('createContentAndCopyDraftPage');
714 
715  $response = $this->executeFrontendRequest(
716  (new InternalRequest())->withPageId($this->recordIds['copiedPageId']),
717  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
718  );
719  $responseSectionsDraft = ResponseContent::fromString((string)$response->getBody())->getSections();
720  self::assertThat($responseSectionsDraft, $this->‪getRequestSectionHasRecordConstraint()
721  ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
722  }
723 
727  public function ‪createContentAndLocalize()
728  {
729  parent::createContentAndLocalize();
730  $this->actionService->publishRecords([
731  self::TABLE_Content => [$this->recordIds['newContentId']],
732  ]);
733  $this->‪assertAssertionDataSet('createContentAndLocalize');
734 
735  $response = $this->executeFrontendRequest(
736  (new InternalRequest())->withPageId(self::VALUE_PageId)->withLanguageId(self::VALUE_LanguageId),
737  (new InternalRequestContext())->withBackendUserId(self::VALUE_BackendUserId)->withWorkspaceId(self::VALUE_WorkspaceId)
738  );
739  $responseSections = ResponseContent::fromString((string)$response->getBody())->getSections();
740  self::assertThat($responseSections, $this->‪getRequestSectionHasRecordConstraint()
741  ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Testing #1'));
742  }
743 
747  public function ‪createPageAndCopyDraftParentPage()
748  {
749  parent::createPageAndCopyDraftParentPage();
750  $this->actionService->publishRecords([
751  self::TABLE_Page => [$this->recordIds['newPageId'], $this->recordIds['copiedPageId']]
752  ]);
753  $this->‪assertAssertionDataSet('createPageAndCopyDraftParentPage');
754  }
755 
760  {
761  parent::createPlaceholdersAndDeleteDraftParentPage();
762  $this->actionService->publishRecord(self::TABLE_Page, self::VALUE_ParentPageId);
763  $this->‪assertAssertionDataSet('createPlaceholdersAndDeleteDraftParentPage');
764  }
765 }
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\deleteLocalizedContentAndDeleteContent
‪deleteLocalizedContentAndDeleteContent()
Definition: ActionTest.php:154
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\modifyPage
‪modifyPage()
Definition: ActionTest.php:416
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\movePageToDifferentPageAndCreatePageAfterMovedPage
‪movePageToDifferentPageAndCreatePageAfterMovedPage()
Definition: ActionTest.php:676
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setUpFrontendSite
‪setUpFrontendSite(int $pageId, array $additionalLanguages=[])
Definition: AbstractDataHandlerActionTestCase.php:143
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\moveContentToDifferentPageAndHide
‪moveContentToDifferentPageAndHide()
Definition: ActionTest.php:360
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\localizeContent
‪localizeContent()
Definition: ActionTest.php:235
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionHasRecordConstraint
‪HasRecordConstraint getRequestSectionHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:289
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\copyContentToLanguage
‪copyContentToLanguage()
Definition: ActionTest.php:191
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\changeContentSorting
‪changeContentSorting()
Definition: ActionTest.php:291
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionStructureHasRecordConstraint
‪StructureHasRecordConstraint getRequestSectionStructureHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:305
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\movePageToDifferentPageTwice
‪movePageToDifferentPageTwice()
Definition: ActionTest.php:600
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\localizeContentAfterMovedInLiveContent
‪localizeContentAfterMovedInLiveContent()
Definition: ActionTest.php:263
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createPageAndSubPageAndSubPageContent
‪createPageAndSubPageAndSubPageContent()
Definition: ActionTest.php:397
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createContentAndLocalize
‪createContentAndLocalize()
Definition: ActionTest.php:725
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\deleteContent
‪deleteContent()
Definition: ActionTest.php:137
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\changePageSortingAfterSelf
‪changePageSortingAfterSelf()
Definition: ActionTest.php:566
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\changeContentSortingAndCopyDraftPage
‪changeContentSortingAndCopyDraftPage()
Definition: ActionTest.php:694
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\deletePage
‪deletePage()
Definition: ActionTest.php:431
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest
Definition: ActionTest.php:27
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\changeContentSortingAfterSelf
‪changeContentSortingAfterSelf()
Definition: ActionTest.php:306
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase\VALUE_LanguageId
‪const VALUE_LanguageId
Definition: AbstractActionTestCase.php:39
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createPageAndChangePageSorting
‪createPageAndChangePageSorting()
Definition: ActionTest.php:529
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createContentAndCopyDraftPage
‪createContentAndCopyDraftPage()
Definition: ActionTest.php:704
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\hideContentAndMoveToDifferentPage
‪hideContentAndMoveToDifferentPage()
Definition: ActionTest.php:109
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createPlaceholdersAndDeleteDraftParentPage
‪createPlaceholdersAndDeleteDraftParentPage()
Definition: ActionTest.php:757
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\copyPageFreeMode
‪copyPageFreeMode()
Definition: ActionTest.php:492
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\deleteContentAndPage
‪deleteContentAndPage()
Definition: ActionTest.php:446
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\AbstractActionTestCase\VALUE_LanguageIdSecond
‪const VALUE_LanguageIdSecond
Definition: AbstractActionTestCase.php:40
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createPage
‪createPage()
Definition: ActionTest.php:382
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\localizeNestedPagesAndContents
‪localizeNestedPagesAndContents()
Definition: ActionTest.php:461
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\movePageToDifferentPage
‪movePageToDifferentPage()
Definition: ActionTest.php:583
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\hideContent
‪hideContent()
Definition: ActionTest.php:91
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice
‪movePageLocalizedInLiveWorkspaceChangedToDifferentPageTwice()
Definition: ActionTest.php:630
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createPageAndCopyDraftParentPage
‪createPageAndCopyDraftParentPage()
Definition: ActionTest.php:745
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\changePageSorting
‪changePageSorting()
Definition: ActionTest.php:549
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\copyContentToLanguageFromNonDefaultLanguage
‪copyContentToLanguageFromNonDefaultLanguage()
Definition: ActionTest.php:213
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\modifyContent
‪modifyContent()
Definition: ActionTest.php:76
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\movePageLocalizedToDifferentPageTwice
‪movePageLocalizedToDifferentPageTwice()
Definition: ActionTest.php:610
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\copyPage
‪copyPage()
Definition: ActionTest.php:472
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\assertAssertionDataSet
‪assertAssertionDataSet($dataSetName)
Definition: AbstractDataHandlerActionTestCase.php:208
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionDoesNotHaveRecordConstraint
‪DoesNotHaveRecordConstraint getRequestSectionDoesNotHaveRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:297
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\localizeContentAfterMovedContent
‪localizeContentAfterMovedContent()
Definition: ActionTest.php:253
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\movePageLocalizedInLiveToDifferentPageTwice
‪movePageLocalizedInLiveToDifferentPageTwice()
Definition: ActionTest.php:620
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createContents
‪createContents()
Definition: ActionTest.php:40
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\copyContent
‪copyContent()
Definition: ActionTest.php:176
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\$siteLanguageConfiguration
‪array $siteLanguageConfiguration
Definition: AbstractDataHandlerActionTestCase.php:86
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\$assertCleanReferenceIndex
‪bool $assertCleanReferenceIndex
Definition: ActionTest.php:34
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\$assertionDataSetDirectory
‪string $assertionDataSetDirectory
Definition: ActionTest.php:30
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createPageAndMoveCreatedPage
‪createPageAndMoveCreatedPage()
Definition: ActionTest.php:539
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\localizeContentFromNonDefaultLanguage
‪localizeContentFromNonDefaultLanguage()
Definition: ActionTest.php:273
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice
‪movePageLocalizedInLiveWorkspaceDeletedToDifferentPageTwice()
Definition: ActionTest.php:640
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\movePageToDifferentPageAndChangeSorting
‪movePageToDifferentPageAndChangeSorting()
Definition: ActionTest.php:650
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\createContentAndCopyContent
‪createContentAndCopyContent()
Definition: ActionTest.php:59
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\moveContentToDifferentPageAndChangeSorting
‪moveContentToDifferentPageAndChangeSorting()
Definition: ActionTest.php:343
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\AbstractActionTestCase
Definition: AbstractActionTestCase.php:22
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish
Definition: ActionTest.php:16
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\moveContentToDifferentPage
‪moveContentToDifferentPage()
Definition: ActionTest.php:324
‪TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Regular\Publish\ActionTest\localizePage
‪localizePage()
Definition: ActionTest.php:514