‪TYPO3CMS  10.4
TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest:

Public Member Functions

 detectASingleSiteWhenProperRequestIsGiven ()
 
 detectSubsiteInsideNestedUrlStructure ()
 
 detectSubSubsiteInsideNestedUrlStructureDataProvider ()
 
 detectSubSubsiteInsideNestedUrlStructure ($incomingUrl, $expectedSiteIdentifier, $expectedRootPageId, $expectedBase)
 
 detectProperLanguageByIncomingUrlDataProvider ()
 
 detectProperLanguageByIncomingUrl ($incomingUrl, $expectedSiteIdentifier, $expectedRootPageId, $expectedLanguageId, $expectedBase)
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Protected Attributes

bool $resetSingletonInstances = true
 
SiteFinder AccessibleObjectInterface $siteFinder
 
RequestHandlerInterface $siteFoundRequestHandler
 
string $originalLocale
 

Detailed Description

Definition at line 36 of file SiteResolverTest.php.

Member Function Documentation

◆ detectASingleSiteWhenProperRequestIsGiven()

TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::detectASingleSiteWhenProperRequestIsGiven ( )

Expect a URL handed in, as a request. This URL does not have a GET parameter "id" Then the site handling gets triggered, and the URL is taken to resolve a site.

This case tests against a site with no domain or scheme, and successfully finds it.

Test:

Definition at line 106 of file SiteResolverTest.php.

◆ detectProperLanguageByIncomingUrl()

TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::detectProperLanguageByIncomingUrl (   $incomingUrl,
  $expectedSiteIdentifier,
  $expectedRootPageId,
  $expectedLanguageId,
  $expectedBase 
)

Scenario with three one site and three languages Site 1: / Language 0: /en/ Language 1: /fr/ Site 2: /mysubsite/ Language: 2: / Site 3: /mysubsite/micro-site/ Language: 13: /ru/

Test:
‪@dataProvider detectProperLanguageByIncomingUrlDataProvider

Definition at line 336 of file SiteResolverTest.php.

◆ detectProperLanguageByIncomingUrlDataProvider()

TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::detectProperLanguageByIncomingUrlDataProvider ( )

Definition at line 282 of file SiteResolverTest.php.

◆ detectSubsiteInsideNestedUrlStructure()

TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::detectSubsiteInsideNestedUrlStructure ( )

Scenario with two sites Site 1: / Site 2: /mysubsite/

The result should be that site 2 is resolved by the router when calling

www.random-result.com/mysubsite/you-know-why/

Test:

Definition at line 150 of file SiteResolverTest.php.

◆ detectSubSubsiteInsideNestedUrlStructure()

TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::detectSubSubsiteInsideNestedUrlStructure (   $incomingUrl,
  $expectedSiteIdentifier,
  $expectedRootPageId,
  $expectedBase 
)

Scenario with three sites Site 1: / Site 2: /mysubsite/ Site 3: /mysubsite/micro-site/

The result should be that site 2 is resolved by the router when calling

www.random-result.com/mysubsite/you-know-why/

and site 3 when calling www.random-result.com/mysubsite/micro-site/oh-yes-you-do/

Test:
‪@dataProvider detectSubSubsiteInsideNestedUrlStructureDataProvider

Definition at line 231 of file SiteResolverTest.php.

◆ detectSubSubsiteInsideNestedUrlStructureDataProvider()

TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::detectSubSubsiteInsideNestedUrlStructureDataProvider ( )

Definition at line 191 of file SiteResolverTest.php.

◆ setUp()

TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::setUp ( )
protected

Set up

Definition at line 57 of file SiteResolverTest.php.

◆ tearDown()

TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::tearDown ( )
protected

Definition at line 89 of file SiteResolverTest.php.

Member Data Documentation

◆ $originalLocale

string TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::$originalLocale
protected

Definition at line 52 of file SiteResolverTest.php.

◆ $resetSingletonInstances

bool TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::$resetSingletonInstances = true
protected

Reset singletons created by subject

Definition at line 40 of file SiteResolverTest.php.

◆ $siteFinder

SiteFinder AccessibleObjectInterface TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::$siteFinder
protected

Definition at line 44 of file SiteResolverTest.php.

◆ $siteFoundRequestHandler

RequestHandlerInterface TYPO3\CMS\Frontend\Tests\Unit\Middleware\SiteResolverTest::$siteFoundRequestHandler
protected

Definition at line 48 of file SiteResolverTest.php.