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

Public Member Functions

 constructorSetsAllProperties ()
 
 canSerializeToString ()
 
 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 26 of file UriTest.php.

Member Function Documentation

◆ authorityInfoDataProvider()

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

Definition at line 356 of file UriTest.php.

◆ canEmitOriginFormUrl()

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

Definition at line 379 of file UriTest.php.

◆ canSerializeToString()

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

Definition at line 47 of file UriTest.php.

◆ constructorRaisesExceptionForNonStringURI()

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

@dataProvider invalidConstructorUrisDataProvider

Definition at line 442 of file UriTest.php.

◆ constructorRaisesExceptionForSeriouslyMalformedURI()

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

Definition at line 451 of file UriTest.php.

◆ constructorSetsAllProperties()

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

Definition at line 31 of file UriTest.php.

◆ constructWithUnsupportedSchemeRaisesAnException()

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

@dataProvider invalidSchemesDataProvider

Test:

Definition at line 485 of file UriTest.php.

◆ getAuthorityOmitsPortForStandardSchemePortCombinations()

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

@dataProvider standardSchemePortCombinationsDataProvider

Test:

Definition at line 572 of file UriTest.php.

◆ getAuthorityReturnsExpectedValues()

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

@dataProvider authorityInfoDataProvider

Test:

Definition at line 370 of file UriTest.php.

◆ getFragmentIsNotDoubleEncoded()

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

Definition at line 648 of file UriTest.php.

◆ getFragmentIsProperlyEncoded()

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

Definition at line 638 of file UriTest.php.

◆ getPathDoesNotBecomeDoubleEncoded()

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

Definition at line 594 of file UriTest.php.

◆ getPathIsProperlyEncoded()

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

Definition at line 584 of file UriTest.php.

◆ getPathOnOriginFormRemainsAnEmptyPath()

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

Definition at line 408 of file UriTest.php.

◆ getQueryIsNotDoubleEncoded()

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

@dataProvider queryStringsForEncodingDataProvider

Test:

Definition at line 629 of file UriTest.php.

◆ getQueryIsProperlyEncoded()

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

@dataProvider queryStringsForEncodingDataProvider

Test:

Definition at line 619 of file UriTest.php.

◆ invalidConstructorUrisDataProvider()

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

Definition at line 426 of file UriTest.php.

◆ invalidPathsDataProvider()

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

Definition at line 247 of file UriTest.php.

◆ invalidPortsDataProviderRange()

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

Definition at line 169 of file UriTest.php.

◆ invalidPortsDataProviderType()

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

Definition at line 144 of file UriTest.php.

◆ invalidQueryStringsDataProvider()

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

Definition at line 307 of file UriTest.php.

◆ invalidSchemesDataProvider()

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

Definition at line 470 of file UriTest.php.

◆ noPortAndNoSchemeDoesNotRenderPort()

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

Definition at line 226 of file UriTest.php.

◆ queryStringsForEncodingDataProvider()

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

Definition at line 604 of file UriTest.php.

◆ settingEmptyPathOnAbsoluteUriReturnsAnEmptyPath()

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

Definition at line 389 of file UriTest.php.

◆ standardPortAndNoSchemeDoesRenderPort()

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

Definition at line 217 of file UriTest.php.

◆ standardPortAndSchemeDoesNotRenderPort()

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

Definition at line 208 of file UriTest.php.

◆ standardSchemePortCombinationsDataProvider()

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

Definition at line 560 of file UriTest.php.

◆ stringRepresentationOfAbsoluteUriWithNoPathSetsAnEmptyPath()

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

Definition at line 399 of file UriTest.php.

◆ stringRepresentationOfOriginFormWithNoPathRetainsEmptyPath()

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

Definition at line 417 of file UriTest.php.

◆ validPortsDataProvider()

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

Definition at line 117 of file UriTest.php.

◆ withEmptySchemeReturnsNewInstanceWithAbsoluteUri()

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

Definition at line 517 of file UriTest.php.

◆ withFragmentReturnsNewInstanceWithProvidedFragment()

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

Definition at line 344 of file UriTest.php.

◆ withFragmentStripsFragmentPrefixIfPresent()

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

Definition at line 550 of file UriTest.php.

◆ withHostReturnsNewInstanceWithProvidedHost()

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

Definition at line 93 of file UriTest.php.

◆ withPathIsNotPrefixedWithSlashIfSetWithoutOne()

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

Definition at line 507 of file UriTest.php.

◆ withPathNotSlashPrefixedIsEmittedWithSlashDelimiterWhenUriIsCastToString()

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

Definition at line 530 of file UriTest.php.

◆ withPathRaisesExceptionForInvalidPaths()

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

@dataProvider invalidPathsDataProvider

Test:

Definition at line 262 of file UriTest.php.

◆ withPathRaisesExceptionForInvalidPathsWithFragment()

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

Definition at line 284 of file UriTest.php.

◆ withPathRaisesExceptionForInvalidPathsWithQuery()

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

Definition at line 273 of file UriTest.php.

◆ withPathReturnsNewInstanceWithProvidedPath()

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

Definition at line 235 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 185 of file UriTest.php.

◆ withPortAndNullValueReturnsInstanceWithProvidedPort()

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

Definition at line 105 of file UriTest.php.

◆ withPortRaisesExceptionForInvalidPortsByRange()

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

@dataProvider invalidPortsDataProviderRange

Test:

Definition at line 197 of file UriTest.php.

◆ withPortRaisesExceptionForInvalidPortsByType()

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

@dataProvider invalidPortsDataProviderType

Test:

Definition at line 158 of file UriTest.php.

◆ withPortReturnsNewInstanceWithProvidedPort()

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

@dataProvider validPortsDataProvider

Test:

Definition at line 129 of file UriTest.php.

◆ withQueryRaisesExceptionForInvalidQueryStringsByFragment()

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

Definition at line 333 of file UriTest.php.

◆ withQueryRaisesExceptionForInvalidQueryStringsByType()

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

@dataProvider invalidQueryStringsDataProvider

Test:

Definition at line 322 of file UriTest.php.

◆ withQueryReturnsNewInstanceWithProvidedQuery()

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

Definition at line 295 of file UriTest.php.

◆ withQueryStripsQueryPrefixIfPresent()

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

Definition at line 540 of file UriTest.php.

◆ withSchemeReturnsNewInstanceWithNewScheme()

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

Definition at line 57 of file UriTest.php.

◆ withSchemeStripsOffDelimiter()

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

Definition at line 460 of file UriTest.php.

◆ withSchemeUsingUnsupportedSchemeRaisesAnException()

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

@dataProvider invalidSchemesDataProvider

Test:

Definition at line 496 of file UriTest.php.

◆ withUserInfoReturnsNewInstanceWithProvidedUser()

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

Definition at line 69 of file UriTest.php.

◆ withUserInfoReturnsNewInstanceWithProvidedUserAndPassword()

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

Definition at line 81 of file UriTest.php.