‪TYPO3CMS  11.5
SlugSiteRequestTest.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 
22 use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\Scenario\DataHandlerFactory;
23 use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\Scenario\DataHandlerWriter;
24 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
25 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequestContext;
26 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\ResponseContent;
27 
32 {
33  // Force subrequest-based errors ON, because some tests can't work otherwise.
35  'SYS' => [
36  'encryptionKey' => '4408d27a916d51e624b69af3554f516dbab61037a9f7b9fd6f81b4d3bedeccb6',
37  'features' => [
38  'subrequestPageErrors' => true,
39  ],
40  ],
41  'FE' => [
42  'cacheHash' => [
43  'requireCacheHashPresenceParameters' => ['value', 'testing[value]', 'tx_testing_link[value]'],
44  'excludedParameters' => ['L', 'tx_testing_link[excludedValue]'],
45  'enforceValidation' => true,
46  ],
47  'debug' => false,
48  ],
49  'SC_OPTIONS' => [
50  'Core/TypoScript/TemplateService' => [
51  'runThroughTemplatesPostProcessing' => [
52  'FunctionalTest' => \TYPO3\TestingFramework\Core\Functional\Framework\Frontend\Hook\TypoScriptInstructionModifier::class . '->apply',
53  ],
54  ],
55  ],
56  ];
57 
58  protected function ‪setUp(): void
59  {
60  parent::setUp();
61  $this->withDatabaseSnapshot(function () {
62  $this->‪setUpDatabase();
63  });
64  }
65 
66  protected function ‪setUpDatabase(): void
67  {
68  $backendUser = $this->setUpBackendUserFromFixture(1);
70 
71  $scenarioFile = __DIR__ . '/Fixtures/SlugScenario.yaml';
72  $factory = DataHandlerFactory::fromYamlFile($scenarioFile);
73  $writer = DataHandlerWriter::withBackendUser($backendUser);
74  $writer->invokeFactory($factory);
75  static::failIfArrayIsNotEmpty(
76  $writer->getErrors()
77  );
78 
79  $this->setUpFrontendRootPage(
80  1000,
81  [
82  'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
83  'typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/JsonRenderer.typoscript',
84  ],
85  [
86  'title' => 'ACME Root',
87  ]
88  );
89  }
90 
95  {
96  $domainPaths = [
97  'https://website.local/',
98  'https://website.local/?',
99  // @todo: See how core should act here and activate this or have an own test for this scenario
100  // 'https://website.local//',
101  ];
102 
103  return $this->‪wrapInArray(
104  $this->‪keysFromValues($domainPaths)
105  );
106  }
107 
115  {
117  'website-local',
118  $this->‪buildSiteConfiguration(1000, 'https://website.local/')
119  );
120 
121  $expectedStatusCode = 307;
122  $expectedHeaders = [
123  'X-Redirect-By' => ['TYPO3 Shortcut/Mountpoint'],
124  'location' => ['https://website.local/welcome'],
125  ];
126 
127  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
128  self::assertSame($expectedStatusCode, $response->getStatusCode());
129  self::assertSame($expectedHeaders, $response->getHeaders());
130  }
131 
135  public function ‪shortcutsAreRedirectedDataProvider(): array
136  {
137  $domainPaths = [
138  'https://website.local/',
139  'https://website.local/?',
140  // @todo: See how core should act here and activate this or have an own test for this scenario
141  // 'https://website.local//',
142  ];
143 
144  return $this->‪wrapInArray(
145  $this->‪keysFromValues($domainPaths)
146  );
147  }
148 
155  public function ‪shortcutsAreRedirectedToDefaultSiteLanguage(string $uri): void
156  {
158  'website-local',
159  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
160  [
161  $this->‪buildDefaultLanguageConfiguration('EN', '/en-en/'),
162  ]
163  );
164 
165  $expectedStatusCode = 307;
166  $expectedHeaders = [
167  'location' => ['https://website.local/en-en/'],
168  ];
169 
170  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
171  self::assertSame($expectedStatusCode, $response->getStatusCode());
172  self::assertSame($expectedHeaders, $response->getHeaders());
173  }
174 
181  public function ‪shortcutsAreRedirectedAndRenderFirstSubPage(string $uri): void
182  {
184  'website-local',
185  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
186  [
187  $this->‪buildDefaultLanguageConfiguration('EN', '/en-en/'),
188  ]
189  );
190 
191  $expectedStatusCode = 200;
192  $expectedPageTitle = 'EN: Welcome';
193 
194  $response = $this->executeFrontendSubRequest(
195  new InternalRequest($uri),
196  null,
197  true
198  );
199  $responseStructure = ResponseContent::fromString(
200  (string)$response->getBody()
201  );
202 
203  self::assertSame(
204  $expectedStatusCode,
205  $response->getStatusCode()
206  );
207  self::assertSame(
208  $expectedPageTitle,
209  $responseStructure->getScopePath('page/title')
210  );
211  }
212 
217  {
218  $domainPaths = [
219  'https://website.local/简',
220  'https://website.local/简?',
221  'https://website.local/简/',
222  'https://website.local/简/?',
223  ];
224 
225  return $this->‪wrapInArray(
226  $this->‪keysFromValues($domainPaths)
227  );
228  }
229 
237  {
239  'website-local',
240  $this->‪buildSiteConfiguration(1000, 'https://website.local/简/'),
241  [
242  $this->‪buildDefaultLanguageConfiguration('ZH-CN', '/'),
243  ]
244  );
245 
246  $expectedStatusCode = 307;
247  $expectedHeaders = [
248  'X-Redirect-By' => ['TYPO3 Shortcut/Mountpoint'],
249  // We cannot expect 简 here directly, as they are rawurlencoded() in the used Symfony UrlGenerator.
250  'location' => ['https://website.local/%E7%AE%80/welcome'],
251  ];
252 
253  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
254  self::assertSame($expectedStatusCode, $response->getStatusCode());
255  self::assertSame($expectedHeaders, $response->getHeaders());
256  }
257 
265  {
267  'website-local',
268  $this->‪buildSiteConfiguration(1000, 'https://website.local/简/'),
269  [
270  $this->‪buildDefaultLanguageConfiguration('ZH-CN', '/'),
271  ]
272  );
273 
274  $expectedStatusCode = 200;
275  $expectedPageTitle = 'EN: Welcome';
276 
277  $response = $this->executeFrontendSubRequest(
278  new InternalRequest($uri),
279  null,
280  true
281  );
282  $responseStructure = ResponseContent::fromString(
283  (string)$response->getBody()
284  );
285 
286  self::assertSame(
287  $expectedStatusCode,
288  $response->getStatusCode()
289  );
290  self::assertSame(
291  $expectedPageTitle,
292  $responseStructure->getScopePath('page/title')
293  );
294  }
295 
300  {
302  'website-local',
303  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
304  [
305  $this->‪buildDefaultLanguageConfiguration('EN', '/en-en/'),
306  ],
307  $this->‪buildErrorHandlingConfiguration('Fluid', [404])
308  );
309 
310  $uri = 'https://website.other/any/invalid/slug';
311  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
312  self::assertSame(404, $response->getStatusCode());
313  }
314 
315  public static function ‪siteWithPageIdRequestsAreCorrectlyHandledDataProvider(): \Generator
316  {
317  yield 'valid same-site request is redirected' => ['https://website.local/?id=1000&L=0', 307];
318  yield 'valid same-site request is processed' => ['https://website.local/?id=1100&L=0', 200];
319  yield 'invalid off-site request with unknown domain is denied' => ['https://otherdomain.website.local/?id=3000&L=0', 404];
320  yield 'invalid off-site request with unknown domain and without L parameter is denied' => ['https://otherdomain.website.local/?id=3000', 404];
321  }
322 
331  public function ‪siteWithPageIdRequestsAreCorrectlyHandled(string $uri, int $expectation): void
332  {
334  'website-local',
335  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
336  [
337  $this->‪buildDefaultLanguageConfiguration('EN', '/'),
338  ],
339  $this->‪buildErrorHandlingConfiguration('Fluid', [404])
340  );
341 
342  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
343  self::assertSame($expectation, $response->getStatusCode());
344  }
345 
350  {
352  'website-local',
353  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
354  [
355  $this->‪buildDefaultLanguageConfiguration('EN', '/en-en/'),
356  ],
357  $this->‪buildErrorHandlingConfiguration('Fluid', [404])
358  );
359 
360  $uri = 'https://website.local/any/invalid/slug';
361  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
362 
363  self::assertSame(
364  404,
365  $response->getStatusCode()
366  );
367  self::assertStringContainsString(
368  'message: The requested page does not exist',
369  (string)$response->getBody()
370  );
371  }
372 
377  {
379  'website-local',
380  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
381  [
382  $this->‪buildDefaultLanguageConfiguration('EN', '/en-en/'),
383  ],
384  $this->‪buildErrorHandlingConfiguration('Fluid', [404])
385  );
386 
387  $uri = 'https://website.local/en-en/any/invalid/slug';
388  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
389 
390  self::assertSame(
391  404,
392  $response->getStatusCode()
393  );
394  self::assertStringContainsString(
395  'message: The requested page does not exist',
396  (string)$response->getBody()
397  );
398  }
399 
404  {
406  'website-local',
407  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
408  [
409  $this->‪buildDefaultLanguageConfiguration('EN', '/en-en/'),
410  ],
411  $this->‪buildErrorHandlingConfiguration('Fluid', [500])
412  );
413 
414  $uri = 'https://website.local/en-en/?type=13';
415  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
416 
417  self::assertSame(
418  500,
419  $response->getStatusCode()
420  );
421  self::assertStringContainsString(
422  'message: The page is not configured',
423  (string)$response->getBody()
424  );
425  }
426 
430  public function ‪pageIsRenderedWithPathsDataProvider(): array
431  {
432  $domainPaths = [
433  'https://website.local/en-en/welcome',
434  'https://website.local/fr-fr/bienvenue',
435  'https://website.local/fr-ca/bienvenue',
436  'https://website.local/简/简-bienvenue',
437  ];
438 
439  return array_map(
440  static function (string $uri) {
441  if (str_contains($uri, '/fr-fr/')) {
442  $expectedPageTitle = 'FR: Welcome';
443  } elseif (str_contains($uri, '/fr-ca/')) {
444  $expectedPageTitle = 'FR-CA: Welcome';
445  } elseif (strpos($uri, '/简/') !== false) {
446  $expectedPageTitle = 'ZH-CN: Welcome';
447  } else {
448  $expectedPageTitle = 'EN: Welcome';
449  }
450  return [$uri, $expectedPageTitle];
451  },
452  $this->‪keysFromValues($domainPaths)
453  );
454  }
455 
463  public function ‪pageIsRenderedWithPaths(string $uri, string $expectedPageTitle): void
464  {
466  'website-local',
467  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
468  [
469  $this->‪buildDefaultLanguageConfiguration('EN', '/en-en/'),
470  $this->‪buildLanguageConfiguration('FR', '/fr-fr/', ['EN']),
471  $this->‪buildLanguageConfiguration('FR-CA', '/fr-ca/', ['FR', 'EN']),
472  $this->‪buildLanguageConfiguration('ZH', '/简/', ['EN']),
473  ]
474  );
475 
476  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
477  $responseStructure = ResponseContent::fromString(
478  (string)$response->getBody()
479  );
480 
481  self::assertSame(
482  200,
483  $response->getStatusCode()
484  );
485  self::assertSame(
486  $expectedPageTitle,
487  $responseStructure->getScopePath('page/title')
488  );
489  }
490 
492  {
493  $domainPaths = [
494  'https://website.local/简/简-bienvenue',
495  'https://website.local/fr-fr/zh-bienvenue',
496  'https://website.local/fr-ca/zh-bienvenue',
497  ];
498 
499  return array_map(
500  static function (string $uri) {
501  if (strpos($uri, '/fr-fr/') !== false) {
502  $expectedPageTitle = 'FR: Welcome ZH Default';
503  } elseif (strpos($uri, '/fr-ca/') !== false) {
504  $expectedPageTitle = 'FR-CA: Welcome ZH Default';
505  } else {
506  $expectedPageTitle = 'ZH-CN: Welcome Default';
507  }
508  return [$uri, $expectedPageTitle];
509  },
510  $this->‪keysFromValues($domainPaths)
511  );
512  }
513 
518  public function ‪pageIsRenderedWithPathsAndChineseDefaultLanguage(string $uri, string $expectedPageTitle): void
519  {
521  'website-local',
522  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
523  [
524  $this->‪buildDefaultLanguageConfiguration('ZH-CN', '/简/'),
525  $this->‪buildLanguageConfiguration('FR', '/fr-fr/', ['EN']),
526  $this->‪buildLanguageConfiguration('FR-CA', '/fr-ca/', ['FR', 'EN']),
527  ]
528  );
529 
530  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
531  $responseStructure = ResponseContent::fromString(
532  (string)$response->getBody()
533  );
534 
535  self::assertSame(
536  200,
537  $response->getStatusCode()
538  );
539  self::assertSame(
540  $expectedPageTitle,
541  $responseStructure->getScopePath('page/title')
542  );
543  }
544 
549  {
550  $domainPaths = [
551  'https://website.us/welcome',
552  'https://website.fr/bienvenue',
553  'https://website.ca/bienvenue',
554  // Explicitly testing chinese character domains
555  'https://website.简/简-bienvenue',
556  ];
557 
558  return array_map(
559  static function (string $uri) {
560  if (str_contains($uri, '.fr/')) {
561  $expectedPageTitle = 'FR: Welcome';
562  } elseif (str_contains($uri, '.ca/')) {
563  $expectedPageTitle = 'FR-CA: Welcome';
564  } elseif (strpos($uri, '.简/') !== false) {
565  $expectedPageTitle = 'ZH-CN: Welcome';
566  } else {
567  $expectedPageTitle = 'EN: Welcome';
568  }
569  return [$uri, $expectedPageTitle];
570  },
571  $this->‪keysFromValues($domainPaths)
572  );
573  }
574 
582  public function ‪pageIsRenderedWithDomains(string $uri, string $expectedPageTitle): void
583  {
585  'website-local',
586  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
587  [
588  $this->‪buildDefaultLanguageConfiguration('EN', 'https://website.us/'),
589  $this->‪buildLanguageConfiguration('FR', 'https://website.fr/', ['EN']),
590  $this->‪buildLanguageConfiguration('FR-CA', 'https://website.ca/', ['FR', 'EN']),
591  $this->‪buildLanguageConfiguration('ZH', 'https://website.简/', ['EN']),
592  ]
593  );
594 
595  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
596  $responseStructure = ResponseContent::fromString(
597  (string)$response->getBody()
598  );
599 
600  self::assertSame(
601  200,
602  $response->getStatusCode()
603  );
604  self::assertSame(
605  $expectedPageTitle,
606  $responseStructure->getScopePath('page/title')
607  );
608  }
609 
614  {
615  $uri = 'https://website.us/features/frontend-editing/';
616 
618  'website-local',
619  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
620  [
621  $this->‪buildDefaultLanguageConfiguration('EN', 'https://website.us/'),
622  $this->‪buildLanguageConfiguration('FR', 'https://website.fr/', ['EN']),
623  $this->‪buildLanguageConfiguration('FR-CA', 'https://website.ca/', ['FR', 'EN']),
624  ]
625  );
626 
627  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
628  $responseStructure = ResponseContent::fromString((string)$response->getBody());
629  self::assertSame(200, $response->getStatusCode());
630  self::assertSame('EN: Frontend Editing', $responseStructure->getScopePath('page/title'));
631  }
632 
637  {
638  $uri = 'https://website.us/features/frontend-editing';
639 
641  'website-local',
642  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
643  [
644  $this->‪buildDefaultLanguageConfiguration('EN', 'https://website.us/'),
645  $this->‪buildLanguageConfiguration('FR', 'https://website.fr/', ['EN']),
646  $this->‪buildLanguageConfiguration('FR-CA', 'https://website.ca/', ['FR', 'EN']),
647  ]
648  );
649 
650  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
651  $responseStructure = ResponseContent::fromString((string)$response->getBody());
652  self::assertSame(200, $response->getStatusCode());
653  self::assertSame('EN: Frontend Editing', $responseStructure->getScopePath('page/title'));
654  }
655 
660  {
661  $uri = 'https://website.us/features/';
662 
664  'website-local',
665  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
666  [
667  $this->‪buildDefaultLanguageConfiguration('EN', 'https://website.us/'),
668  $this->‪buildLanguageConfiguration('FR', 'https://website.fr/', ['EN']),
669  $this->‪buildLanguageConfiguration('FR-CA', 'https://website.ca/', ['FR', 'EN']),
670  ]
671  );
672 
673  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
674  $responseStructure = ResponseContent::fromString((string)$response->getBody());
675  self::assertSame(200, $response->getStatusCode());
676  self::assertSame('EN: Features', $responseStructure->getScopePath('page/title'));
677  }
678 
683  {
684  $uri = 'https://website.us/features';
685 
687  'website-local',
688  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
689  [
690  $this->‪buildDefaultLanguageConfiguration('EN', 'https://website.us/'),
691  $this->‪buildLanguageConfiguration('FR', 'https://website.fr/', ['EN']),
692  $this->‪buildLanguageConfiguration('FR-CA', 'https://website.ca/', ['FR', 'EN']),
693  ]
694  );
695 
696  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
697  $responseStructure = ResponseContent::fromString((string)$response->getBody());
698  self::assertSame(200, $response->getStatusCode());
699  self::assertSame('EN: Features', $responseStructure->getScopePath('page/title'));
700  }
701 
706  {
707  $instructions = [
708  // frontend user 1
709  ['https://website.local/my-acme/whitepapers', 1, 'Whitepapers'],
710  ['https://website.local/my-acme/whitepapers/products', 1, 'Products'],
711  ['https://website.local/my-acme/whitepapers/solutions', 1, 'Solutions'],
712  // frontend user 2
713  ['https://website.local/my-acme/whitepapers', 2, 'Whitepapers'],
714  ['https://website.local/my-acme/whitepapers/products', 2, 'Products'],
715  ['https://website.local/my-acme/whitepapers/research', 2, 'Research'],
716  ['https://website.local/my-acme/forecasts', 2, 'Forecasts'],
717  ['https://website.local/my-acme/forecasts/current-year', 2, 'Current Year'],
718  // frontend user 3
719  ['https://website.local/my-acme/whitepapers', 3, 'Whitepapers'],
720  ['https://website.local/my-acme/whitepapers/products', 3, 'Products'],
721  ['https://website.local/my-acme/whitepapers/solutions', 3, 'Solutions'],
722  ['https://website.local/my-acme/whitepapers/research', 3, 'Research'],
723  ['https://website.local/my-acme/forecasts', 3, 'Forecasts'],
724  ['https://website.local/my-acme/forecasts/current-year', 3, 'Current Year'],
725  ];
726 
727  return $this->‪keysFromTemplate($instructions, '%1$s (user:%2$s)');
728  }
729 
738  public function ‪restrictedPageIsRendered(string $uri, int $frontendUserId, string $expectedPageTitle): void
739  {
741  'website-local',
742  $this->‪buildSiteConfiguration(1000, 'https://website.local/')
743  );
744 
745  $response = $this->executeFrontendSubRequest(
746  new InternalRequest($uri),
747  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
748  );
749  $responseStructure = ResponseContent::fromString(
750  (string)$response->getBody()
751  );
752 
753  self::assertSame(
754  200,
755  $response->getStatusCode()
756  );
757  self::assertSame(
758  $expectedPageTitle,
759  $responseStructure->getScopePath('page/title')
760  );
761  }
762 
767  {
768  $instructions = [
769  // frontend user 4
770  ['https://website.local/sysfolder-restricted', 4, 'FEGroups Restricted'],
771  ];
772 
773  return $this->‪keysFromTemplate($instructions, '%1$s (user:%2$s)');
774  }
775 
784  public function ‪restrictedPageWithParentSysFolderIsRendered(string $uri, int $frontendUserId, string $expectedPageTitle): void
785  {
787  'website-local',
788  $this->‪buildSiteConfiguration(1000, 'https://website.local/')
789  );
790 
791  $response = $this->executeFrontendSubRequest(
792  new InternalRequest($uri),
793  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
794  );
795  $responseStructure = ResponseContent::fromString(
796  (string)$response->getBody()
797  );
798 
799  self::assertSame(
800  200,
801  $response->getStatusCode()
802  );
803  self::assertSame(
804  $expectedPageTitle,
805  $responseStructure->getScopePath('page/title')
806  );
807  }
808 
813  {
814  $instructions = [
815  // no frontend user given
816  ['https://website.local/my-acme/whitepapers', 0],
817  // ['https://website.local/my-acme/whitepapers/products', 0], // @todo extendToSubpages currently missing
818  ['https://website.local/my-acme/whitepapers/solutions', 0],
819  ['https://website.local/my-acme/whitepapers/research', 0],
820  ['https://website.local/my-acme/forecasts', 0],
821  // ['https://website.local/my-acme/forecasts/current-year', 0], // @todo extendToSubpages currently missing
822  // frontend user 1
823  ['https://website.local/my-acme/whitepapers/research', 1],
824  ['https://website.local/my-acme/forecasts', 1],
825  // ['https://website.local/my-acme/forecasts/current-year', 1], // @todo extendToSubpages currently missing
826  // frontend user 2
827  ['https://website.local/my-acme/whitepapers/solutions', 2],
828  ];
829 
830  return $this->‪keysFromTemplate($instructions, '%1$s (user:%2$s)');
831  }
832 
841  {
843  'website-local',
844  $this->‪buildSiteConfiguration(1000, 'https://website.local/')
845  );
846 
847  $response = $this->executeFrontendSubRequest(
848  new InternalRequest($uri),
849  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
850  );
851 
852  self::assertSame(
853  403,
854  $response->getStatusCode()
855  );
856  self::assertThat(
857  (string)$response->getBody(),
858  self::logicalOr(
859  self::stringContains('Reason: ID was not an accessible page'),
860  self::stringContains('Reason: Subsection was found and not accessible')
861  )
862  );
863  }
864 
873  {
875  'website-local',
876  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
877  [],
878  $this->‪buildErrorHandlingConfiguration('Fluid', [403])
879  );
880 
881  $response = $this->executeFrontendSubRequest(
882  new InternalRequest($uri),
883  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
884  );
885 
886  self::assertSame(
887  403,
888  $response->getStatusCode()
889  );
890  self::assertStringContainsString(
891  'reasons: code,fe_group',
892  (string)$response->getBody()
893  );
894  self::assertThat(
895  (string)$response->getBody(),
896  self::logicalOr(
897  self::stringContains('message: ID was not an accessible page'),
898  self::stringContains('message: Subsection was found and not accessible')
899  )
900  );
901  }
902 
911  {
913  'website-local',
914  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
915  [],
916  $this->‪buildErrorHandlingConfiguration('Page', [403])
917  );
918 
919  $response = $this->executeFrontendSubRequest(
920  new InternalRequest($uri),
921  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
922  );
923 
924  self::assertSame(
925  403,
926  $response->getStatusCode()
927  );
928  self::assertThat(
929  (string)$response->getBody(),
930  self::logicalOr(
931  self::stringContains('That page is forbidden to you'),
932  self::stringContains('ID was not an accessible page'),
933  self::stringContains('Subsection was found and not accessible')
934  )
935  );
936  }
937 
946  {
948  'website-local',
949  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
950  [],
951  $this->‪buildErrorHandlingConfiguration('PHP', [403])
952  );
953 
954  $response = $this->executeFrontendSubRequest(
955  new InternalRequest($uri),
956  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
957  );
958  $json = json_decode((string)$response->getBody(), true);
959 
960  self::assertSame(
961  403,
962  $response->getStatusCode()
963  );
964  self::assertThat(
965  $json['message'] ?? null,
966  self::logicalOr(
967  self::identicalTo('ID was not an accessible page'),
968  self::identicalTo('Subsection was found and not accessible')
969  )
970  );
971  }
972 
977  {
978  $instructions = [
979  // no frontend user given
980  ['https://website.local/sysfolder-restricted', 0],
981  // frontend user 1
982  ['https://website.local/sysfolder-restricted', 1],
983  // frontend user 2
984  ['https://website.local/sysfolder-restricted', 2],
985  // frontend user 3
986  ['https://website.local/sysfolder-restricted', 3],
987  ];
988 
989  return $this->‪keysFromTemplate($instructions, '%1$s (user:%2$s)');
990  }
991 
1000  {
1002  'website-local',
1003  $this->‪buildSiteConfiguration(1000, 'https://website.local/')
1004  );
1005 
1006  $response = $this->executeFrontendSubRequest(
1007  new InternalRequest($uri),
1008  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
1009  );
1010 
1011  self::assertSame(
1012  403,
1013  $response->getStatusCode()
1014  );
1015  self::assertThat(
1016  (string)$response->getBody(),
1017  self::logicalOr(
1018  self::stringContains('Reason: ID was not an accessible page'),
1019  self::stringContains('Reason: Subsection was found and not accessible')
1020  )
1021  );
1022  }
1023 
1032  {
1034  'website-local',
1035  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1036  [],
1037  $this->‪buildErrorHandlingConfiguration('Fluid', [403])
1038  );
1039 
1040  $response = $this->executeFrontendSubRequest(
1041  new InternalRequest($uri),
1042  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
1043  );
1044 
1045  self::assertSame(
1046  403,
1047  $response->getStatusCode()
1048  );
1049  self::assertStringContainsString(
1050  'reasons: code,fe_group',
1051  (string)$response->getBody()
1052  );
1053  self::assertThat(
1054  (string)$response->getBody(),
1055  self::logicalOr(
1056  self::stringContains('message: ID was not an accessible page'),
1057  self::stringContains('message: Subsection was found and not accessible')
1058  )
1059  );
1060  }
1061 
1070  {
1072  'website-local',
1073  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1074  [],
1075  $this->‪buildErrorHandlingConfiguration('Page', [403])
1076  );
1077 
1078  $response = $this->executeFrontendSubRequest(
1079  new InternalRequest($uri),
1080  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
1081  );
1082 
1083  self::assertSame(
1084  403,
1085  $response->getStatusCode()
1086  );
1087  self::assertThat(
1088  (string)$response->getBody(),
1089  self::logicalOr(
1090  self::stringContains('That page is forbidden to you'),
1091  self::stringContains('ID was not an accessible page'),
1092  self::stringContains('Subsection was found and not accessible')
1093  )
1094  );
1095  }
1096 
1105  {
1107  'website-local',
1108  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1109  [],
1110  $this->‪buildErrorHandlingConfiguration('PHP', [403])
1111  );
1112 
1113  $response = $this->executeFrontendSubRequest(
1114  new InternalRequest($uri),
1115  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
1116  );
1117  $json = json_decode((string)$response->getBody(), true);
1118 
1119  self::assertSame(
1120  403,
1121  $response->getStatusCode()
1122  );
1123  self::assertThat(
1124  $json['message'] ?? null,
1125  self::logicalOr(
1126  self::identicalTo('ID was not an accessible page'),
1127  self::identicalTo('Subsection was found and not accessible')
1128  )
1129  );
1130  }
1131 
1136  {
1137  $instructions = [
1138  // hidden page, always 404
1139  ['https://website.local/never-visible-working-on-it', 0],
1140  ['https://website.local/never-visible-working-on-it', 1],
1141  // hidden fe group restricted and fegroup generally okay
1142  ['https://website.local/sysfolder-restricted-hidden', 4],
1143  ];
1144 
1145  return $this->‪keysFromTemplate($instructions, '%1$s (user:%2$s)');
1146  }
1147 
1152  public function ‪hiddenPageSends404ResponseRegardlessOfVisitorGroup(string $uri, int $frontendUserId): void
1153  {
1155  'website-local',
1156  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1157  [],
1158  $this->‪buildErrorHandlingConfiguration('PHP', [404])
1159  );
1160 
1161  $response = $this->executeFrontendSubRequest(
1162  new InternalRequest($uri),
1163  (new InternalRequestContext())->withFrontendUserId($frontendUserId)
1164  );
1165  $json = json_decode((string)$response->getBody(), true);
1166 
1167  self::assertSame(
1168  404,
1169  $response->getStatusCode()
1170  );
1171  self::assertThat(
1172  $json['message'] ?? null,
1173  self::identicalTo('The requested page does not exist!')
1174  );
1175  }
1176 
1181  {
1182  $domainPaths = [
1183  'https://website.local/',
1184  ];
1185 
1186  $queries = [
1187  '',
1188  'welcome',
1189  ];
1190 
1191  $customQueries = [
1192  '?testing[value]=1',
1193  '?testing[value]=1&cHash=',
1194  '?testing[value]=1&cHash=WRONG',
1195  ];
1196 
1197  return $this->‪wrapInArray(
1198  $this->‪keysFromValues(
1199  ‪PermutationUtility::meltStringItems([$domainPaths, $queries, $customQueries])
1200  )
1201  );
1202  }
1203 
1211  {
1213  'website-local',
1214  $this->‪buildSiteConfiguration(1000, 'https://website.local/')
1215  );
1216 
1217  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
1218  self::assertSame(404, $response->getStatusCode());
1219  }
1220 
1228  {
1230  'website-local',
1231  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1232  [],
1233  $this->‪buildErrorHandlingConfiguration('Fluid', [404])
1234  );
1235 
1236  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
1237 
1238  self::assertSame(
1239  404,
1240  $response->getStatusCode()
1241  );
1242  self::assertThat(
1243  (string)$response->getBody(),
1244  self::logicalOr(
1245  self::stringContains('message: Request parameters could not be validated (&amp;cHash empty)'),
1246  self::stringContains('message: Request parameters could not be validated (&amp;cHash comparison failed)')
1247  )
1248  );
1249  }
1250 
1258  {
1260  'website-local',
1261  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1262  [],
1263  $this->‪buildErrorHandlingConfiguration('Page', [404, 500])
1264  );
1265 
1266  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
1267 
1268  self::assertSame(
1269  404,
1270  $response->getStatusCode()
1271  );
1272  self::assertThat(
1273  (string)$response->getBody(),
1274  self::stringContains('That page was not found')
1275  );
1276  }
1277 
1285  {
1287  'website-local',
1288  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1289  [],
1290  $this->‪buildErrorHandlingConfiguration('PHP', [404])
1291  );
1292 
1293  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
1294  $json = json_decode((string)$response->getBody(), true);
1295 
1296  self::assertSame(
1297  404,
1298  $response->getStatusCode()
1299  );
1300  self::assertThat(
1301  $json['message'] ?? null,
1302  self::logicalOr(
1303  self::identicalTo('Request parameters could not be validated (&cHash empty)'),
1304  self::identicalTo('Request parameters could not be validated (&cHash comparison failed)')
1305  )
1306  );
1307  }
1308 
1313  {
1314  $domainPaths = [
1315  'https://website.local/',
1316  ];
1317 
1318  // cHash has been calculated with encryption key set to
1319  // '4408d27a916d51e624b69af3554f516dbab61037a9f7b9fd6f81b4d3bedeccb6'
1320  $queries = [
1321  // @todo Currently fails since cHash is verified after(!) redirect to page 1100
1322  // '?cHash=7d1f13fa91159dac7feb3c824936b39d',
1323  // '?cHash=7d1f13fa91159dac7feb3c824936b39d',
1324  'welcome?cHash=f42b850e435f0cedd366f5db749fc1af',
1325  ];
1326 
1327  $customQueries = [
1328  '&testing[value]=1',
1329  ];
1330 
1331  $dataSet = $this->‪wrapInArray(
1332  $this->‪keysFromValues(
1333  ‪PermutationUtility::meltStringItems([$domainPaths, $queries, $customQueries])
1334  )
1335  );
1336 
1337  return $dataSet;
1338  }
1339 
1346  public function ‪pageIsRenderedWithValidCacheHash($uri): void
1347  {
1349  'website-local',
1350  $this->‪buildSiteConfiguration(1000, 'https://website.local/')
1351  );
1352 
1353  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
1354  $responseStructure = ResponseContent::fromString(
1355  (string)$response->getBody()
1356  );
1357  self::assertSame(
1358  '1',
1359  $responseStructure->getScopePath('getpost/testing.value')
1360  );
1361  }
1362 
1364  {
1365  return [
1366  'shortcut is redirected' => [
1367  'https://website.local/cross-site-shortcut',
1368  307,
1369  [
1370  'X-Redirect-By' => ['TYPO3 Shortcut/Mountpoint'],
1371  'location' => ['https://blog.local/authors'],
1372  ],
1373  ],
1374  ];
1375  }
1376 
1381  public function ‪crossSiteShortcutsAreRedirected(string $uri, int $expectedStatusCode, array $expectedHeaders): void
1382  {
1384  'website-local',
1385  $this->‪buildSiteConfiguration(1000, 'https://website.local/')
1386  );
1388  'blog-local',
1389  $this->‪buildSiteConfiguration(2000, 'https://blog.local/')
1390  );
1391  $this->setUpFrontendRootPage(
1392  2000,
1393  [
1394  'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript',
1395  'typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/JsonRenderer.typoscript',
1396  ],
1397  [
1398  'title' => 'ACME Blog',
1399  ]
1400  );
1401 
1402  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
1403  self::assertSame($expectedStatusCode, $response->getStatusCode());
1404  self::assertSame($expectedHeaders, $response->getHeaders());
1405  }
1406 
1408  {
1409  yield 'Live page with logged-in user' => [
1410  'url' => 'https://website.local/en-en/welcome',
1411  'pageTitle' => 'EN: Welcome',
1412  'Online Page ID' => 1100,
1413  'Workspace ID' => 0,
1414  'Backend User ID' => 1,
1415  'statusCode' => 200,
1416  ];
1417  yield 'Live page with logged-in user accessed even though versioned page slug was changed' => [
1418  'url' => 'https://website.local/en-en/welcome',
1419  'pageTitle' => 'EN: Welcome to ACME Inc',
1420  'Online Page ID' => 1100,
1421  'Workspace ID' => 1,
1422  'Backend User ID' => 1,
1423  'statusCode' => 200,
1424  ];
1425  yield 'Versioned page with logged-in user and modified slug' => [
1426  'url' => 'https://website.local/en-en/welcome-modified',
1427  'pageTitle' => 'EN: Welcome to ACME Inc',
1428  'Online Page ID' => 1100,
1429  'Workspace ID' => 1,
1430  'Backend User ID' => 1,
1431  'statusCode' => 200,
1432  ];
1433  yield 'Versioned page without logged-in user renders 404' => [
1434  'url' => 'https://website.local/en-en/welcome-modified',
1435  'pageTitle' => null,
1436  'Online Page ID' => null,
1437  'Workspace ID' => 1,
1438  'Backend User ID' => 0,
1439  'statusCode' => 404,
1440  ];
1441  }
1442 
1447  public function ‪pageIsRenderedForVersionedPage(string $url, ?string $expectedPageTitle, ?int $expectedPageId, int $workspaceId, int $backendUserId, int $expectedStatusCode): void
1448  {
1450  'website-local',
1451  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1452  [
1453  $this->‪buildDefaultLanguageConfiguration('EN', '/en-en/'),
1454  $this->‪buildLanguageConfiguration('FR', '/fr-fr/', ['EN']),
1455  $this->‪buildLanguageConfiguration('FR-CA', '/fr-ca/', ['FR', 'EN']),
1456  ]
1457  );
1458  $response = $this->executeFrontendSubRequest(
1459  (new InternalRequest($url)),
1460  (new InternalRequestContext())
1461  ->withWorkspaceId($backendUserId !== 0 ? $workspaceId : 0)
1462  ->withBackendUserId($backendUserId)
1463  );
1464  $responseStructure = ResponseContent::fromString(
1465  (string)$response->getBody()
1466  );
1467 
1468  self::assertSame($expectedStatusCode, $response->getStatusCode());
1469  self::assertSame($expectedPageId, $responseStructure->getScopePath('page/uid') ? (int)$responseStructure->getScopePath('page/uid') : null);
1470  self::assertSame($expectedPageTitle, $responseStructure->getScopePath('page/title'));
1471  }
1472 
1474  {
1475  yield 'Default slug with default base resolves' => [
1476  'uri' => 'https://website.local/welcome/',
1477  'recordUpdates' => [],
1478  'fallbackIdentifiers' => [
1479  'EN',
1480  ],
1481  'fallbackType' => 'strict',
1482  'expectedStatusCode' => 200,
1483  'expectedPageTitle' => 'EN: Welcome',
1484  ];
1485 
1486  yield 'FR slug with FR base resolves' => [
1487  'uri' => 'https://website.local/fr-fr/bienvenue/',
1488  'recordUpdates' => [],
1489  'fallbackIdentifiers' => [
1490  'EN',
1491  ],
1492  'fallbackType' => 'strict',
1493  'expectedStatusCode' => 200,
1494  'expectedPageTitle' => 'FR: Welcome',
1495  ];
1496 
1497  // Using default language slug with language base should be page not found if language page is active.
1498  yield 'Default slug with default base do not resolve' => [
1499  'uri' => 'https://website.local/fr-fr/welcome/',
1500  'recordUpdates' => [],
1501  'fallbackIdentifiers' => [
1502  'EN',
1503  ],
1504  'fallbackType' => 'strict',
1505  'expectedStatusCode' => 404,
1506  'expectedPageTitle' => null,
1507  ];
1508 
1509  // Using default language slug with language base resolves for inactive / hidden language page
1510  yield 'Default slug with default base but inactive language page resolves' => [
1511  'uri' => 'https://website.local/fr-fr/welcome/',
1512  'recordUpdates' => [
1513  'pages' => [
1514  [
1515  'data' => [
1516  'hidden' => 1,
1517  ],
1518  'identifiers' => [
1519  'uid' => 1101,
1520  ],
1521  'types' => [],
1522  ],
1523  ],
1524  ],
1525  'fallbackIdentifiers' => [
1526  'EN',
1527  ],
1528  'fallbackType' => 'strict',
1529  'expectedStatusCode' => 200,
1530  'expectedPageTitle' => 'EN: Welcome',
1531  ];
1532  }
1533 
1539  public function ‪defaultLanguagePageNotResolvedForSiteLanguageBaseIfLanguagePageExists(string $uri, array $recordUpdates, array $fallbackIdentifiers, string $fallbackType, int $expectedStatusCode, ?string $expectedPageTitle): void
1540  {
1542  'website-local',
1543  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1544  [
1545  $this->‪buildDefaultLanguageConfiguration('EN', '/'),
1546  $this->‪buildLanguageConfiguration('FR', 'https://website.local/fr-fr/', ['EN']),
1547  ]
1548  );
1549  if ($recordUpdates !== []) {
1550  foreach ($recordUpdates as $table => $records) {
1551  foreach ($records as $record) {
1552  $this->getConnectionPool()->getConnectionForTable($table)
1553  ->update(
1554  $table,
1555  $record['data'] ?? [],
1556  $record['identifiers'] ?? [],
1557  $record['types'] ?? []
1558  );
1559  }
1560  }
1561  }
1562 
1563  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
1564  $responseStructure = ResponseContent::fromString(
1565  (string)$response->getBody()
1566  );
1567 
1568  self::assertSame(
1569  $expectedStatusCode,
1570  $response->getStatusCode()
1571  );
1572  if ($expectedPageTitle !== null) {
1573  self::assertSame(
1574  $expectedPageTitle,
1575  $responseStructure->getScopePath('page/title')
1576  );
1577  }
1578  }
1579 
1581  {
1582  yield 'Default slug with default base resolves' => [
1583  'uri' => 'https://website.local/en-en/welcome/',
1584  'recordUpdates' => [],
1585  'fallbackIdentifiers' => [
1586  'EN',
1587  ],
1588  'fallbackType' => 'strict',
1589  'expectedStatusCode' => 200,
1590  'expectedPageTitle' => 'EN: Welcome',
1591  ];
1592 
1593  yield 'FR slug with FR base resolves' => [
1594  'uri' => 'https://website.local/bienvenue/',
1595  'recordUpdates' => [],
1596  'fallbackIdentifiers' => [
1597  'EN',
1598  ],
1599  'fallbackType' => 'strict',
1600  'expectedStatusCode' => 200,
1601  'expectedPageTitle' => 'FR: Welcome',
1602  ];
1603 
1604  // Using default language slug with language base should be page not found if language page is active.
1605  yield 'Default slug with default base do not resolve' => [
1606  'uri' => 'https://website.local/welcome/',
1607  'recordUpdates' => [],
1608  'fallbackIdentifiers' => [
1609  'EN',
1610  ],
1611  'fallbackType' => 'strict',
1612  'expectedStatusCode' => 404,
1613  'expectedPageTitle' => null,
1614  ];
1615 
1616  // Using default language slug with language base should be page not found if language page is active.
1617  yield 'Default slug with default base do not resolve strict without fallback' => [
1618  'uri' => 'https://website.local/welcome/',
1619  'recordUpdates' => [],
1620  'fallbackIdentifiers' => [],
1621  'fallbackType' => 'fallback',
1622  'expectedStatusCode' => 404,
1623  'expectedPageTitle' => null,
1624  ];
1625 
1626  // Using default language slug with language base should be page not found if language page is active.
1627  yield 'Default slug with default base do not resolve fallback' => [
1628  'uri' => 'https://website.local/welcome/',
1629  'recordUpdates' => [],
1630  'fallbackIdentifiers' => [
1631  'EN',
1632  ],
1633  'fallbackType' => 'fallback',
1634  'expectedStatusCode' => 404,
1635  'expectedPageTitle' => null,
1636  ];
1637 
1638  // Using default language slug with language base resolves for inactive / hidden language page
1639  yield 'Default slug with default base but inactive language page resolves' => [
1640  'uri' => 'https://website.local/welcome/',
1641  'recordUpdates' => [
1642  'pages' => [
1643  [
1644  'data' => [
1645  'hidden' => 1,
1646  ],
1647  'identifiers' => [
1648  'uid' => 1101,
1649  ],
1650  'types' => [],
1651  ],
1652  ],
1653  ],
1654  'fallbackIdentifiers' => [
1655  'EN',
1656  ],
1657  'fallbackType' => 'strict',
1658  'expectedStatusCode' => 200,
1659  'expectedPageTitle' => 'EN: Welcome',
1660  ];
1661  }
1662 
1668  public function ‪defaultLanguagePageNotResolvedForSiteLanguageBaseWithNonDefaultLanguageShorterUriIfLanguagePageExists(string $uri, array $recordUpdates, array $fallbackIdentifiers, string $fallbackType, int $expectedStatusCode, ?string $expectedPageTitle): void
1669  {
1671  'website-local',
1672  $this->‪buildSiteConfiguration(1000, 'https://website.local/'),
1673  [
1674  $this->‪buildDefaultLanguageConfiguration('EN', '/en-en'),
1675  $this->‪buildLanguageConfiguration('FR', 'https://website.local/', ['EN']),
1676  ]
1677  );
1678  if ($recordUpdates !== []) {
1679  foreach ($recordUpdates as $table => $records) {
1680  foreach ($records as $record) {
1681  $this->getConnectionPool()->getConnectionForTable($table)
1682  ->update(
1683  $table,
1684  $record['data'] ?? [],
1685  $record['identifiers'] ?? [],
1686  $record['types'] ?? []
1687  );
1688  }
1689  }
1690  }
1691 
1692  $response = $this->executeFrontendSubRequest(new InternalRequest($uri));
1693  $responseStructure = ResponseContent::fromString(
1694  (string)$response->getBody()
1695  );
1696 
1697  self::assertSame(
1698  $expectedStatusCode,
1699  $response->getStatusCode()
1700  );
1701  if ($expectedPageTitle !== null) {
1702  self::assertSame(
1703  $expectedPageTitle,
1704  $responseStructure->getScopePath('page/title')
1705  );
1706  }
1707  }
1708 }
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorWithoutHavingErrorHandling
‪restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorWithoutHavingErrorHandling(string $uri, int $frontendUserId)
Definition: SlugSiteRequestTest.php:999
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\defaultLanguagePageNotResolvedForSiteLanguageBaseWithNonDefaultLanguageShorterUriIfLanguagePageExists
‪defaultLanguagePageNotResolvedForSiteLanguageBaseWithNonDefaultLanguageShorterUriIfLanguagePageExists(string $uri, array $recordUpdates, array $fallbackIdentifiers, string $fallbackType, int $expectedStatusCode, ?string $expectedPageTitle)
Definition: SlugSiteRequestTest.php:1668
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest
Definition: SlugSiteRequestTest.php:32
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageWithParentSysFolderIsRendered
‪restrictedPageWithParentSysFolderIsRendered(string $uri, int $frontendUserId, string $expectedPageTitle)
Definition: SlugSiteRequestTest.php:784
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildErrorHandlingConfiguration
‪array buildErrorHandlingConfiguration(string $handler, array $codes)
Definition: SiteBasedTestTrait.php:186
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\defaultLanguagePageNotResolvedForSiteLanguageBaseIfLanguagePageExistsDataProvider
‪defaultLanguagePageNotResolvedForSiteLanguageBaseIfLanguagePageExistsDataProvider()
Definition: SlugSiteRequestTest.php:1473
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorWithHavingPageErrorHandling
‪restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorWithHavingPageErrorHandling(string $uri, int $frontendUserId)
Definition: SlugSiteRequestTest.php:1069
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageRequestNotFoundInvalidCacheHashWithoutHavingErrorHandling
‪pageRequestNotFoundInvalidCacheHashWithoutHavingErrorHandling(string $uri)
Definition: SlugSiteRequestTest.php:1210
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\invalidSlugInsideSiteLanguageResultsInNotFoundResponse
‪invalidSlugInsideSiteLanguageResultsInNotFoundResponse()
Definition: SlugSiteRequestTest.php:376
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageRequestSendsNotFoundResponseWithInvalidCacheHashWithHavingPageErrorHandling
‪pageRequestSendsNotFoundResponseWithInvalidCacheHashWithHavingPageErrorHandling(string $uri)
Definition: SlugSiteRequestTest.php:1257
‪TYPO3\CMS\Core\Utility\PermutationUtility\meltStringItems
‪static array meltStringItems(array $payload, string $previousResult='')
Definition: PermutationUtility.php:36
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageWithTrailingSlashSlugIsRenderedIfRequestedWithoutSlash
‪pageWithTrailingSlashSlugIsRenderedIfRequestedWithoutSlash()
Definition: SlugSiteRequestTest.php:636
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageIsRendered
‪restrictedPageIsRendered(string $uri, int $frontendUserId, string $expectedPageTitle)
Definition: SlugSiteRequestTest.php:738
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\setUp
‪setUp()
Definition: SlugSiteRequestTest.php:58
‪TYPO3
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorWithHavingFluidErrorHandling
‪restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorWithHavingFluidErrorHandling(string $uri, int $frontendUserId)
Definition: SlugSiteRequestTest.php:872
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildLanguageConfiguration
‪array buildLanguageConfiguration(string $identifier, string $base, array $fallbackIdentifiers=[], string $fallbackType=null)
Definition: SiteBasedTestTrait.php:144
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\setUpDatabase
‪setUpDatabase()
Definition: SlugSiteRequestTest.php:66
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\writeSiteConfiguration
‪writeSiteConfiguration(string $identifier, array $site=[], array $languages=[], array $errorHandling=[])
Definition: SiteBasedTestTrait.php:58
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageRenderingStopsWithInvalidCacheHashDataProvider
‪array pageRenderingStopsWithInvalidCacheHashDataProvider()
Definition: SlugSiteRequestTest.php:1180
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\siteWithPageIdRequestsAreCorrectlyHandledDataProvider
‪static siteWithPageIdRequestsAreCorrectlyHandledDataProvider()
Definition: SlugSiteRequestTest.php:315
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\AbstractTestCase\keysFromTemplate
‪array keysFromTemplate(array $array, string $template, callable $callback=null)
Definition: AbstractTestCase.php:102
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\AbstractTestCase
Definition: AbstractTestCase.php:29
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\requestsAreRedirectedWithoutHavingDefaultSiteLanguageDataProvider
‪array requestsAreRedirectedWithoutHavingDefaultSiteLanguageDataProvider()
Definition: SlugSiteRequestTest.php:94
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\defaultLanguagePageNotResolvedForSiteLanguageBaseWithNonDefaultLanguageShorterUriIfLanguagePageExistsDataProvider
‪defaultLanguagePageNotResolvedForSiteLanguageBaseWithNonDefaultLanguageShorterUriIfLanguagePageExistsDataProvider()
Definition: SlugSiteRequestTest.php:1580
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorWithHavingPhpErrorHandling
‪restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorWithHavingPhpErrorHandling(string $uri, int $frontendUserId)
Definition: SlugSiteRequestTest.php:1104
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\unconfiguredTypeNumResultsIn500Error
‪unconfiguredTypeNumResultsIn500Error()
Definition: SlugSiteRequestTest.php:403
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedWithValidCacheHashDataProvider
‪array pageIsRenderedWithValidCacheHashDataProvider()
Definition: SlugSiteRequestTest.php:1312
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedForVersionedPageDataProvider
‪pageIsRenderedForVersionedPageDataProvider()
Definition: SlugSiteRequestTest.php:1407
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedWithPathsDataProvider
‪array pageIsRenderedWithPathsDataProvider()
Definition: SlugSiteRequestTest.php:430
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\requestsAreRedirectedWithoutHavingDefaultSiteLanguage
‪requestsAreRedirectedWithoutHavingDefaultSiteLanguage(string $uri)
Definition: SlugSiteRequestTest.php:114
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorWithHavingPhpErrorHandling
‪restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorWithHavingPhpErrorHandling(string $uri, int $frontendUserId)
Definition: SlugSiteRequestTest.php:945
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildDefaultLanguageConfiguration
‪array buildDefaultLanguageConfiguration(string $identifier, string $base)
Definition: SiteBasedTestTrait.php:126
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\shortcutsAreRedirectedToDefaultSiteLanguage
‪shortcutsAreRedirectedToDefaultSiteLanguage(string $uri)
Definition: SlugSiteRequestTest.php:155
‪TYPO3\CMS\Core\Core\Bootstrap\initializeLanguageObject
‪static initializeLanguageObject()
Definition: Bootstrap.php:598
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\shortcutsAreRedirectedAndRenderFirstSubPage
‪shortcutsAreRedirectedAndRenderFirstSubPage(string $uri)
Definition: SlugSiteRequestTest.php:181
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageWithoutTrailingSlashSlugIsRenderedIfRequestedWithoutSlash
‪pageWithoutTrailingSlashSlugIsRenderedIfRequestedWithoutSlash()
Definition: SlugSiteRequestTest.php:682
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageIsRenderedDataProvider
‪array restrictedPageIsRenderedDataProvider()
Definition: SlugSiteRequestTest.php:705
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\defaultLanguagePageNotResolvedForSiteLanguageBaseIfLanguagePageExists
‪defaultLanguagePageNotResolvedForSiteLanguageBaseIfLanguagePageExists(string $uri, array $recordUpdates, array $fallbackIdentifiers, string $fallbackType, int $expectedStatusCode, ?string $expectedPageTitle)
Definition: SlugSiteRequestTest.php:1539
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\shortcutsAreRedirectedDataProvider
‪array shortcutsAreRedirectedDataProvider()
Definition: SlugSiteRequestTest.php:135
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\shortcutsAreRedirectedToDefaultSiteLanguageWithChineseCharacterInBase
‪shortcutsAreRedirectedToDefaultSiteLanguageWithChineseCharacterInBase(string $uri)
Definition: SlugSiteRequestTest.php:236
‪TYPO3\CMS\Core\Utility\PermutationUtility
Definition: PermutationUtility.php:24
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorDataProvider
‪array restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorDataProvider()
Definition: SlugSiteRequestTest.php:976
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageWithTrailingSlashSlugIsRenderedIfRequestedWithSlash
‪pageWithTrailingSlashSlugIsRenderedIfRequestedWithSlash()
Definition: SlugSiteRequestTest.php:613
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\siteWithPageIdRequestsAreCorrectlyHandled
‪siteWithPageIdRequestsAreCorrectlyHandled(string $uri, int $expectation)
Definition: SlugSiteRequestTest.php:331
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\crossSiteShortcutsAreRedirectedDataProvider
‪crossSiteShortcutsAreRedirectedDataProvider()
Definition: SlugSiteRequestTest.php:1363
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\AbstractTestCase\wrapInArray
‪array wrapInArray(array $array)
Definition: AbstractTestCase.php:68
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\AbstractTestCase\keysFromValues
‪array keysFromValues(array $array)
Definition: AbstractTestCase.php:82
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\hiddenPageSends404ResponseRegardlessOfVisitorGroup
‪hiddenPageSends404ResponseRegardlessOfVisitorGroup(string $uri, int $frontendUserId)
Definition: SlugSiteRequestTest.php:1152
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\shortcutsAreRedirectedAndRenderFirstSubPageWithChineseCharacterInBase
‪shortcutsAreRedirectedAndRenderFirstSubPageWithChineseCharacterInBase(string $uri)
Definition: SlugSiteRequestTest.php:264
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\shortcutsAreRedirectedDataProviderWithChineseCharacterInBase
‪array shortcutsAreRedirectedDataProviderWithChineseCharacterInBase()
Definition: SlugSiteRequestTest.php:216
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedWithPaths
‪pageIsRenderedWithPaths(string $uri, string $expectedPageTitle)
Definition: SlugSiteRequestTest.php:463
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\invalidSiteResultsInNotFoundResponse
‪invalidSiteResultsInNotFoundResponse()
Definition: SlugSiteRequestTest.php:299
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedForVersionedPage
‪pageIsRenderedForVersionedPage(string $url, ?string $expectedPageTitle, ?int $expectedPageId, int $workspaceId, int $backendUserId, int $expectedStatusCode)
Definition: SlugSiteRequestTest.php:1447
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedWithPathsAndChineseDefaultLanguageDataProvider
‪pageIsRenderedWithPathsAndChineseDefaultLanguageDataProvider()
Definition: SlugSiteRequestTest.php:491
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedWithPathsAndChineseDefaultLanguage
‪pageIsRenderedWithPathsAndChineseDefaultLanguage(string $uri, string $expectedPageTitle)
Definition: SlugSiteRequestTest.php:518
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling
Definition: AbstractTestCase.php:18
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorWithoutHavingErrorHandling
‪restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorWithoutHavingErrorHandling(string $uri, int $frontendUserId)
Definition: SlugSiteRequestTest.php:840
‪TYPO3\CMS\Core\Core\Bootstrap
Definition: Bootstrap.php:70
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageRequestSendsNotFoundResponseWithInvalidCacheHashWithHavingFluidErrorHandling
‪pageRequestSendsNotFoundResponseWithInvalidCacheHashWithHavingFluidErrorHandling(string $uri)
Definition: SlugSiteRequestTest.php:1227
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildSiteConfiguration
‪array buildSiteConfiguration(int $rootPageId, string $base='')
Definition: SiteBasedTestTrait.php:111
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageWithParentSysFolderIsRenderedDataProvider
‪array restrictedPageWithParentSysFolderIsRenderedDataProvider()
Definition: SlugSiteRequestTest.php:766
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorDataProvider
‪array restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorDataProvider()
Definition: SlugSiteRequestTest.php:812
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorWithHavingPageErrorHandling
‪restrictedPageSendsForbiddenResponseWithUnauthorizedVisitorWithHavingPageErrorHandling(string $uri, int $frontendUserId)
Definition: SlugSiteRequestTest.php:910
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\crossSiteShortcutsAreRedirected
‪crossSiteShortcutsAreRedirected(string $uri, int $expectedStatusCode, array $expectedHeaders)
Definition: SlugSiteRequestTest.php:1381
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedWithValidCacheHash
‪pageIsRenderedWithValidCacheHash($uri)
Definition: SlugSiteRequestTest.php:1346
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\hiddenPageSends404ResponseRegardlessOfVisitorGroupDataProvider
‪array hiddenPageSends404ResponseRegardlessOfVisitorGroupDataProvider()
Definition: SlugSiteRequestTest.php:1135
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageRequestSendsNotFoundResponseWithInvalidCacheHashWithHavingPhpErrorHandling
‪pageRequestSendsNotFoundResponseWithInvalidCacheHashWithHavingPhpErrorHandling(string $uri)
Definition: SlugSiteRequestTest.php:1284
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\invalidSlugOutsideSiteLanguageResultsInNotFoundResponse
‪invalidSlugOutsideSiteLanguageResultsInNotFoundResponse()
Definition: SlugSiteRequestTest.php:349
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\$configurationToUseInTestInstance
‪$configurationToUseInTestInstance
Definition: SlugSiteRequestTest.php:34
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageWithoutTrailingSlashSlugIsRenderedIfRequestedWithSlash
‪pageWithoutTrailingSlashSlugIsRenderedIfRequestedWithSlash()
Definition: SlugSiteRequestTest.php:659
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorWithHavingFluidErrorHandling
‪restrictedPageWithParentSysFolderSendsForbiddenResponseWithUnauthorizedVisitorWithHavingFluidErrorHandling(string $uri, int $frontendUserId)
Definition: SlugSiteRequestTest.php:1031
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedWithDomains
‪pageIsRenderedWithDomains(string $uri, string $expectedPageTitle)
Definition: SlugSiteRequestTest.php:582
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\pageIsRenderedWithDomainsDataProvider
‪array pageIsRenderedWithDomainsDataProvider()
Definition: SlugSiteRequestTest.php:548