‪TYPO3CMS  11.5
TYPO3\CMS\Core\Tests\Unit\Http\UriTest Class Reference
Inheritance diagram for TYPO3\CMS\Core\Tests\Unit\Http\UriTest:

Public Member Functions

 constructorSetsAllProperties ()
 
 canSerializeToStringDataProvider ()
 
 canSerializeToString (string $uri)
 
 withSchemeReturnsNewInstanceWithNewScheme ()
 
 withUserInfoReturnsNewInstanceWithProvidedUser ()
 
 withUserInfoReturnsNewInstanceWithProvidedUserAndPassword ()
 
 withHostReturnsNewInstanceWithProvidedHost ()
 
 withPortAndNullValueReturnsInstanceWithProvidedPort ()
 
array validPortsDataProvider ()
 
 withPortReturnsNewInstanceWithProvidedPort ($port)
 
array invalidPortsDataProviderType ()
 
 withPortRaisesExceptionForInvalidPortsByType ($port)
 
array invalidPortsDataProviderRange ()
 
 withPortAcceptsBooleanTrueAsPortOne ()
 
 withPortRaisesExceptionForInvalidPortsByRange ($port)
 
 standardPortAndSchemeDoesNotRenderPort ()
 
 standardPortAndNoSchemeDoesRenderPort ()
 
 noPortAndNoSchemeDoesNotRenderPort ()
 
 withPathReturnsNewInstanceWithProvidedPath ()
 
array invalidPathsDataProvider ()
 
 withPathRaisesExceptionForInvalidPaths ($path)
 
 withPathRaisesExceptionForInvalidPathsWithQuery ()
 
 withPathRaisesExceptionForInvalidPathsWithFragment ()
 
 withQueryReturnsNewInstanceWithProvidedQuery ()
 
array invalidQueryStringsDataProvider ()
 
 withQueryRaisesExceptionForInvalidQueryStringsByType ($query)
 
 withQueryRaisesExceptionForInvalidQueryStringsByFragment ()
 
 withFragmentReturnsNewInstanceWithProvidedFragment ()
 
array authorityInfoDataProvider ()
 
 getAuthorityReturnsExpectedValues ($url, $expected)
 
 canEmitOriginFormUrl ()
 
 settingEmptyPathOnAbsoluteUriReturnsAnEmptyPath ()
 
 stringRepresentationOfAbsoluteUriWithNoPathSetsAnEmptyPath ()
 
 getPathOnOriginFormRemainsAnEmptyPath ()
 
 stringRepresentationOfOriginFormWithNoPathRetainsEmptyPath ()
 
array invalidConstructorUrisDataProvider ()
 
 constructorRaisesExceptionForNonStringURI ($uri)
 
 constructorRaisesExceptionForSeriouslyMalformedURI ()
 
 withSchemeStripsOffDelimiter ()
 
array invalidSchemesDataProvider ()
 
 constructWithUnsupportedSchemeRaisesAnException ($scheme)
 
 withSchemeUsingUnsupportedSchemeRaisesAnException ($scheme)
 
 withPathIsNotPrefixedWithSlashIfSetWithoutOne ()
 
 withEmptySchemeReturnsNewInstanceWithAbsoluteUri ()
 
 withPathNotSlashPrefixedIsEmittedWithSlashDelimiterWhenUriIsCastToString ()
 
 withQueryStripsQueryPrefixIfPresent ()
 
 withFragmentStripsFragmentPrefixIfPresent ()
 
array standardSchemePortCombinationsDataProvider ()
 
 getAuthorityOmitsPortForStandardSchemePortCombinations ($scheme, $port)
 
 getPathIsProperlyEncoded ()
 
 getPathDoesNotBecomeDoubleEncoded ()
 
array queryStringsForEncodingDataProvider ()
 
 getQueryIsProperlyEncoded ($query, $expected)
 
 getQueryIsNotDoubleEncoded ($query, $expected)
 
 getFragmentIsProperlyEncoded ()
 
 getFragmentIsNotDoubleEncoded ()
 

Detailed Description

Testcase for \TYPO3\CMS\Core\Http\Uri

Adapted from https://github.com/phly/http/

Definition at line 28 of file UriTest.php.

Member Function Documentation

◆ authorityInfoDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::authorityInfoDataProvider ( )
Returns
‪array

Definition at line 365 of file UriTest.php.

◆ canEmitOriginFormUrl()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::canEmitOriginFormUrl ( )
Test:

Definition at line 388 of file UriTest.php.

◆ canSerializeToString()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::canSerializeToString ( string  $uri)
Test:
‪@dataProvider canSerializeToStringDataProvider

Definition at line 58 of file UriTest.php.

◆ canSerializeToStringDataProvider()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::canSerializeToStringDataProvider ( )

Definition at line 46 of file UriTest.php.

◆ constructorRaisesExceptionForNonStringURI()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::constructorRaisesExceptionForNonStringURI (   $uri)

@dataProvider invalidConstructorUrisDataProvider

Definition at line 451 of file UriTest.php.

◆ constructorRaisesExceptionForSeriouslyMalformedURI()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::constructorRaisesExceptionForSeriouslyMalformedURI ( )
Test:

Definition at line 460 of file UriTest.php.

◆ constructorSetsAllProperties()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::constructorSetsAllProperties ( )
Test:

Definition at line 33 of file UriTest.php.

◆ constructWithUnsupportedSchemeRaisesAnException()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::constructWithUnsupportedSchemeRaisesAnException (   $scheme)

@dataProvider invalidSchemesDataProvider

Test:

Definition at line 494 of file UriTest.php.

◆ getAuthorityOmitsPortForStandardSchemePortCombinations()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::getAuthorityOmitsPortForStandardSchemePortCombinations (   $scheme,
  $port 
)

@dataProvider standardSchemePortCombinationsDataProvider

Test:

Definition at line 581 of file UriTest.php.

◆ getAuthorityReturnsExpectedValues()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::getAuthorityReturnsExpectedValues (   $url,
  $expected 
)

@dataProvider authorityInfoDataProvider

Test:

Definition at line 379 of file UriTest.php.

◆ getFragmentIsNotDoubleEncoded()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::getFragmentIsNotDoubleEncoded ( )
Test:

Definition at line 657 of file UriTest.php.

◆ getFragmentIsProperlyEncoded()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::getFragmentIsProperlyEncoded ( )
Test:

Definition at line 647 of file UriTest.php.

◆ getPathDoesNotBecomeDoubleEncoded()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::getPathDoesNotBecomeDoubleEncoded ( )
Test:

Definition at line 603 of file UriTest.php.

◆ getPathIsProperlyEncoded()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::getPathIsProperlyEncoded ( )
Test:

Definition at line 593 of file UriTest.php.

◆ getPathOnOriginFormRemainsAnEmptyPath()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::getPathOnOriginFormRemainsAnEmptyPath ( )
Test:

Definition at line 417 of file UriTest.php.

◆ getQueryIsNotDoubleEncoded()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::getQueryIsNotDoubleEncoded (   $query,
  $expected 
)

@dataProvider queryStringsForEncodingDataProvider

Test:

Definition at line 638 of file UriTest.php.

◆ getQueryIsProperlyEncoded()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::getQueryIsProperlyEncoded (   $query,
  $expected 
)

@dataProvider queryStringsForEncodingDataProvider

Test:

Definition at line 628 of file UriTest.php.

◆ invalidConstructorUrisDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::invalidConstructorUrisDataProvider ( )
Returns
‪array

Definition at line 435 of file UriTest.php.

◆ invalidPathsDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::invalidPathsDataProvider ( )
Returns
‪array

Definition at line 256 of file UriTest.php.

◆ invalidPortsDataProviderRange()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::invalidPortsDataProviderRange ( )
Returns
‪array

Definition at line 178 of file UriTest.php.

◆ invalidPortsDataProviderType()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::invalidPortsDataProviderType ( )
Returns
‪array

Definition at line 153 of file UriTest.php.

◆ invalidQueryStringsDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::invalidQueryStringsDataProvider ( )
Returns
‪array

Definition at line 316 of file UriTest.php.

◆ invalidSchemesDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::invalidSchemesDataProvider ( )
Returns
‪array

Definition at line 479 of file UriTest.php.

◆ noPortAndNoSchemeDoesNotRenderPort()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::noPortAndNoSchemeDoesNotRenderPort ( )
Test:

Definition at line 235 of file UriTest.php.

◆ queryStringsForEncodingDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::queryStringsForEncodingDataProvider ( )
Returns
‪array

Definition at line 613 of file UriTest.php.

◆ settingEmptyPathOnAbsoluteUriReturnsAnEmptyPath()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::settingEmptyPathOnAbsoluteUriReturnsAnEmptyPath ( )
Test:

Definition at line 398 of file UriTest.php.

◆ standardPortAndNoSchemeDoesRenderPort()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::standardPortAndNoSchemeDoesRenderPort ( )
Test:

Definition at line 226 of file UriTest.php.

◆ standardPortAndSchemeDoesNotRenderPort()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::standardPortAndSchemeDoesNotRenderPort ( )
Test:

Definition at line 217 of file UriTest.php.

◆ standardSchemePortCombinationsDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::standardSchemePortCombinationsDataProvider ( )
Returns
‪array

Definition at line 569 of file UriTest.php.

◆ stringRepresentationOfAbsoluteUriWithNoPathSetsAnEmptyPath()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::stringRepresentationOfAbsoluteUriWithNoPathSetsAnEmptyPath ( )
Test:

Definition at line 408 of file UriTest.php.

◆ stringRepresentationOfOriginFormWithNoPathRetainsEmptyPath()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::stringRepresentationOfOriginFormWithNoPathRetainsEmptyPath ( )
Test:

Definition at line 426 of file UriTest.php.

◆ validPortsDataProvider()

array TYPO3\CMS\Core\Tests\Unit\Http\UriTest::validPortsDataProvider ( )
Returns
‪array

Definition at line 126 of file UriTest.php.

◆ withEmptySchemeReturnsNewInstanceWithAbsoluteUri()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withEmptySchemeReturnsNewInstanceWithAbsoluteUri ( )
Test:

Definition at line 526 of file UriTest.php.

◆ withFragmentReturnsNewInstanceWithProvidedFragment()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withFragmentReturnsNewInstanceWithProvidedFragment ( )
Test:

Definition at line 353 of file UriTest.php.

◆ withFragmentStripsFragmentPrefixIfPresent()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withFragmentStripsFragmentPrefixIfPresent ( )
Test:

Definition at line 559 of file UriTest.php.

◆ withHostReturnsNewInstanceWithProvidedHost()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withHostReturnsNewInstanceWithProvidedHost ( )
Test:

Definition at line 102 of file UriTest.php.

◆ withPathIsNotPrefixedWithSlashIfSetWithoutOne()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPathIsNotPrefixedWithSlashIfSetWithoutOne ( )
Test:

Definition at line 516 of file UriTest.php.

◆ withPathNotSlashPrefixedIsEmittedWithSlashDelimiterWhenUriIsCastToString()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPathNotSlashPrefixedIsEmittedWithSlashDelimiterWhenUriIsCastToString ( )
Test:

Definition at line 539 of file UriTest.php.

◆ withPathRaisesExceptionForInvalidPaths()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPathRaisesExceptionForInvalidPaths (   $path)

@dataProvider invalidPathsDataProvider

Test:

Definition at line 271 of file UriTest.php.

◆ withPathRaisesExceptionForInvalidPathsWithFragment()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPathRaisesExceptionForInvalidPathsWithFragment ( )
Test:

Definition at line 293 of file UriTest.php.

◆ withPathRaisesExceptionForInvalidPathsWithQuery()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPathRaisesExceptionForInvalidPathsWithQuery ( )
Test:

Definition at line 282 of file UriTest.php.

◆ withPathReturnsNewInstanceWithProvidedPath()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPathReturnsNewInstanceWithProvidedPath ( )
Test:

Definition at line 244 of file UriTest.php.

◆ withPortAcceptsBooleanTrueAsPortOne()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPortAcceptsBooleanTrueAsPortOne ( )
Test:
Todo:

: Currently, boolean true is interpreted as 1 by canBeInterpretedAsInteger().

: This test shows that, but there is an inconsistency and maybe it would be better

: if the code would not accept 'true' as valid port but throw an exception instead.

: If that is changed, 'true' should be added to the 'invalid type' data provider above.

Definition at line 194 of file UriTest.php.

◆ withPortAndNullValueReturnsInstanceWithProvidedPort()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPortAndNullValueReturnsInstanceWithProvidedPort ( )
Test:

Definition at line 114 of file UriTest.php.

◆ withPortRaisesExceptionForInvalidPortsByRange()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPortRaisesExceptionForInvalidPortsByRange (   $port)

@dataProvider invalidPortsDataProviderRange

Test:

Definition at line 206 of file UriTest.php.

◆ withPortRaisesExceptionForInvalidPortsByType()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPortRaisesExceptionForInvalidPortsByType (   $port)

@dataProvider invalidPortsDataProviderType

Test:

Definition at line 167 of file UriTest.php.

◆ withPortReturnsNewInstanceWithProvidedPort()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withPortReturnsNewInstanceWithProvidedPort (   $port)

@dataProvider validPortsDataProvider

Test:

Definition at line 138 of file UriTest.php.

◆ withQueryRaisesExceptionForInvalidQueryStringsByFragment()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withQueryRaisesExceptionForInvalidQueryStringsByFragment ( )
Test:

Definition at line 342 of file UriTest.php.

◆ withQueryRaisesExceptionForInvalidQueryStringsByType()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withQueryRaisesExceptionForInvalidQueryStringsByType (   $query)

@dataProvider invalidQueryStringsDataProvider

Test:

Definition at line 331 of file UriTest.php.

◆ withQueryReturnsNewInstanceWithProvidedQuery()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withQueryReturnsNewInstanceWithProvidedQuery ( )
Test:

Definition at line 304 of file UriTest.php.

◆ withQueryStripsQueryPrefixIfPresent()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withQueryStripsQueryPrefixIfPresent ( )
Test:

Definition at line 549 of file UriTest.php.

◆ withSchemeReturnsNewInstanceWithNewScheme()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withSchemeReturnsNewInstanceWithNewScheme ( )
Test:

Definition at line 66 of file UriTest.php.

◆ withSchemeStripsOffDelimiter()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withSchemeStripsOffDelimiter ( )
Test:

Definition at line 469 of file UriTest.php.

◆ withSchemeUsingUnsupportedSchemeRaisesAnException()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withSchemeUsingUnsupportedSchemeRaisesAnException (   $scheme)

@dataProvider invalidSchemesDataProvider

Test:

Definition at line 505 of file UriTest.php.

◆ withUserInfoReturnsNewInstanceWithProvidedUser()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withUserInfoReturnsNewInstanceWithProvidedUser ( )
Test:

Definition at line 78 of file UriTest.php.

◆ withUserInfoReturnsNewInstanceWithProvidedUserAndPassword()

TYPO3\CMS\Core\Tests\Unit\Http\UriTest::withUserInfoReturnsNewInstanceWithProvidedUserAndPassword ( )
Test:

Definition at line 90 of file UriTest.php.