|
15 | 15 | * The TYPO3 project - inspiring people to share! |
16 | 16 | */ |
17 | 17 |
|
| 18 | +use TYPO3\CMS\Core\Configuration\SiteConfiguration; |
18 | 19 | use TYPO3\CMS\Core\Core\Bootstrap; |
| 20 | +use TYPO3\CMS\Core\Site\SiteFinder; |
| 21 | +use TYPO3\CMS\Core\Utility\GeneralUtility; |
19 | 22 | use TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\ApplicableConjunction; |
20 | 23 | use TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\AspectDeclaration; |
21 | 24 | use TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\Framework\Builder\Builder; |
@@ -1177,4 +1180,33 @@ public function defaultExtbaseControllerActionNamesAreAppliedWithAdditionalNonMa |
1177 | 1180 |
|
1178 | 1181 | self::assertSame($expectation, (string)$response->getBody()); |
1179 | 1182 | } |
| 1183 | + |
| 1184 | + /** |
| 1185 | + * @test |
| 1186 | + */ |
| 1187 | + public function unmappedPageTypeDecoratorIsAddedAsRegularQueryParam(): void |
| 1188 | + { |
| 1189 | + $this->mergeSiteConfiguration('archive-acme-com', [ |
| 1190 | + 'routeEnhancers' => [ |
| 1191 | + 'PageType' => [ |
| 1192 | + 'type' => 'PageType', |
| 1193 | + 'default' => '/', |
| 1194 | + 'index' => '', |
| 1195 | + 'map' => [ |
| 1196 | + '/' => 0, |
| 1197 | + 'sitemap.xml' => '1533906435' |
| 1198 | + ] |
| 1199 | + ] |
| 1200 | + ] |
| 1201 | + ]); |
| 1202 | + |
| 1203 | + GeneralUtility::makeInstance(SiteConfiguration::class, $this->instancePath . '/typo3conf/sites/')->getAllExistingSites(false); |
| 1204 | + $site = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByIdentifier('archive-acme-com'); |
| 1205 | + $uri = $site->getRouter()->generateUri(3000); |
| 1206 | + self::assertEquals('https://archive.acme.com/', (string)$uri); |
| 1207 | + $uri = $site->getRouter()->generateUri(3000, ['type' => '1533906435']); |
| 1208 | + self::assertEquals('https://archive.acme.com/sitemap.xml', (string)$uri); |
| 1209 | + $uri = $site->getRouter()->generateUri(3000, ['type' => '13']); |
| 1210 | + self::assertEquals('https://archive.acme.com/?type=13', (string)$uri); |
| 1211 | + } |
1180 | 1212 | } |
0 commit comments