‪TYPO3CMS  11.5
TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest:
TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\AbstractTestCase TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait

Public Member Functions

array hierarchicalMenuIsGeneratedDataProvider ()
 
 hierarchicalMenuIsGenerated (string $accessedUrl, array $expectation)
 
 requestsResolvePageIdAndMountPointParameterDataProvider ()
 
 requestsResolvePageIdAndMountPointParameter (string $uri, int $rootPageId, int $expectedPageId, ?string $expectedMountPointParameter)
 
array mountPointPagesShowContentAsConfiguredDataProvider ()
 
 mountPointPagesShowContentAsConfigured (string $uri, string $expected)
 

Protected Member Functions

 setUp ()
 
 setUpDatabase ()
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\AbstractTestCase
array wrapInArray (array $array)
 
array keysFromValues (array $array)
 
array keysFromTemplate (array $array, string $template, ?callable $callback=null)
 
ArrayValueInstruction createTypoLinkUrlInstruction (array $typoScript)
 
ArrayValueInstruction createHierarchicalMenuProcessorInstruction (array $typoScript)
 
ArrayValueInstruction createLanguageMenuProcessorInstruction (array $typoScript)
 
array filterMenu (array $menu, array $keepNames=['title', 'link'])
 
- ‪Protected Member Functions inherited from ‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait
 writeSiteConfiguration (string $identifier, array $site=[], array $languages=[], array $errorHandling=[])
 
 mergeSiteConfiguration (string $identifier, array $overrides)
 
array buildSiteConfiguration (int $rootPageId, string $base='')
 
array buildDefaultLanguageConfiguration (string $identifier, string $base)
 
array buildLanguageConfiguration (string $identifier, string $base, array $fallbackIdentifiers=[], ?string $fallbackType=null)
 
array buildErrorHandlingConfiguration (string $handler, array $codes)
 
mixed resolveLanguagePreset (string $identifier)
 
InternalRequest applyInstructions (InternalRequest $request, AbstractInstruction ... $instructions)
 
AbstractInstruction mergeInstruction (AbstractInstruction $current, AbstractInstruction $other)
 

Additional Inherited Members

- ‪Static Protected Member Functions inherited from ‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait
static failIfArrayIsNotEmpty (array $items)
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\AbstractTestCase
const LANGUAGE_PRESETS
 
 $configurationToUseInTestInstance
 
 $coreExtensionsToLoad = array( 'workspaces' )
 

Detailed Description

Test case for frontend requests showing menus / links and resolving URLs with MountPoints

The global website defines

  • ‪A products area with the current products
  • ‪Within the products area we want to show the archived products (mountpoint to archived products)
  • ‪An archive page shows all archived information (mountpoint to archive)

The canadian website mirrors the main products area (mountpoint to products), the news and shows a link to the main site.

Same goes to the US website with an other language setup and some minor other pages, but also pages with the same slug.

The archive contains archived products and archived news.

Since links underneath mountpoints can only be reached by default the test suite is validating URLS of menu generation, but also resolving the links to the pages within a Mountpoint.

So we end up with this:

  • ‪Global site has two MountPoint Pages
    • ‪Archived products
      • ‪Speciality: The slug of the archived page is called "/products" - same as the mount point
    • ‪All archived content
      • ‪Speciality: The mounted page only contains a "/" as its a rootpage
  • Canadian site has two MountPoint Pages

    • ‪Products
      • ‪Speciality: Nested mountpoints: Products ("Global") -> Archived Products ("Global Archive")
    • ‪News
      • ‪News of Canada - MountPoint within the same site
      • ‪Archived news - MountPoint to another site
    Todo:

    add Tests for having a PageFolder as mounted page (e.g. id 10000)

    Add tests for multilingual setups

    Add tests with various TypoScript settings activated

Definition at line 62 of file MountPointTest.php.

Member Function Documentation

◆ hierarchicalMenuIsGenerated()

TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest::hierarchicalMenuIsGenerated ( string  $accessedUrl,
array  $expectation 
)
Parameters
string$accessedUrl
array$expectation
Test:
‪@dataProvider hierarchicalMenuIsGeneratedDataProvider

Definition at line 399 of file MountPointTest.php.

References TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\AbstractTestCase\createHierarchicalMenuProcessorInstruction(), and TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\AbstractTestCase\filterMenu().

◆ hierarchicalMenuIsGeneratedDataProvider()

array TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest::hierarchicalMenuIsGeneratedDataProvider ( )
Returns
‪array

Definition at line 162 of file MountPointTest.php.

◆ mountPointPagesShowContentAsConfigured()

TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest::mountPointPagesShowContentAsConfigured ( string  $uri,
string  $expected 
)

This test checks for "mount_pid_ol=0", whereas mount_pid_ol=1 should trigger a redirect currently.

Todo:
‪: revisit the "mount_pid_ol=1" redirect, there is some truth to it, but still would remove the context, which does not make sense. Should be revisited. See test above as well.
Parameters
string$uri
string$expected‪@dataProvider mountPointPagesShowContentAsConfiguredDataProvider
Test:

Definition at line 507 of file MountPointTest.php.

◆ mountPointPagesShowContentAsConfiguredDataProvider()

array TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest::mountPointPagesShowContentAsConfiguredDataProvider ( )
Returns
‪array

Definition at line 479 of file MountPointTest.php.

◆ requestsResolvePageIdAndMountPointParameter()

TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest::requestsResolvePageIdAndMountPointParameter ( string  $uri,
int  $rootPageId,
int  $expectedPageId,
?string  $expectedMountPointParameter 
)
Parameters
string$uri
int$rootPageId
int$expectedPageId
string | null$expectedMountPointParameter
Test:
‪@dataProvider requestsResolvePageIdAndMountPointParameterDataProvider

Definition at line 458 of file MountPointTest.php.

◆ requestsResolvePageIdAndMountPointParameterDataProvider()

TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest::requestsResolvePageIdAndMountPointParameterDataProvider ( )

Definition at line 420 of file MountPointTest.php.

◆ setUp()

◆ setUpDatabase()

TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest::setUpDatabase ( )
protected