‪TYPO3CMS  9.5
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 25 of file UriTest.php.

Member Function Documentation

◆ authorityInfoDataProvider()

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

Definition at line 355 of file UriTest.php.

◆ canEmitOriginFormUrl()

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

Definition at line 378 of file UriTest.php.

◆ canSerializeToString()

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

Definition at line 46 of file UriTest.php.

◆ constructorRaisesExceptionForNonStringURI()

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

@dataProvider invalidConstructorUrisDataProvider

Definition at line 441 of file UriTest.php.

◆ constructorRaisesExceptionForSeriouslyMalformedURI()

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

Definition at line 450 of file UriTest.php.

◆ constructorSetsAllProperties()

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

Definition at line 30 of file UriTest.php.

◆ constructWithUnsupportedSchemeRaisesAnException()

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

@dataProvider invalidSchemesDataProvider

Test:

Definition at line 484 of file UriTest.php.

◆ getAuthorityOmitsPortForStandardSchemePortCombinations()

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

@dataProvider standardSchemePortCombinationsDataProvider

Test:

Definition at line 571 of file UriTest.php.

◆ getAuthorityReturnsExpectedValues()

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

@dataProvider authorityInfoDataProvider

Test:

Definition at line 369 of file UriTest.php.

◆ getFragmentIsNotDoubleEncoded()

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

Definition at line 647 of file UriTest.php.

◆ getFragmentIsProperlyEncoded()

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

Definition at line 637 of file UriTest.php.

◆ getPathDoesNotBecomeDoubleEncoded()

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

Definition at line 593 of file UriTest.php.

◆ getPathIsProperlyEncoded()

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

Definition at line 583 of file UriTest.php.

◆ getPathOnOriginFormRemainsAnEmptyPath()

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

Definition at line 407 of file UriTest.php.

◆ getQueryIsNotDoubleEncoded()

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

@dataProvider queryStringsForEncodingDataProvider

Test:

Definition at line 628 of file UriTest.php.

◆ getQueryIsProperlyEncoded()

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

@dataProvider queryStringsForEncodingDataProvider

Test:

Definition at line 618 of file UriTest.php.

◆ invalidConstructorUrisDataProvider()

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

Definition at line 425 of file UriTest.php.

◆ invalidPathsDataProvider()

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

Definition at line 246 of file UriTest.php.

◆ invalidPortsDataProviderRange()

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

Definition at line 168 of file UriTest.php.

◆ invalidPortsDataProviderType()

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

Definition at line 143 of file UriTest.php.

◆ invalidQueryStringsDataProvider()

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

Definition at line 306 of file UriTest.php.

◆ invalidSchemesDataProvider()

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

Definition at line 469 of file UriTest.php.

◆ noPortAndNoSchemeDoesNotRenderPort()

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

Definition at line 225 of file UriTest.php.

◆ queryStringsForEncodingDataProvider()

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

Definition at line 603 of file UriTest.php.

◆ settingEmptyPathOnAbsoluteUriReturnsAnEmptyPath()

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

Definition at line 388 of file UriTest.php.

◆ standardPortAndNoSchemeDoesRenderPort()

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

Definition at line 216 of file UriTest.php.

◆ standardPortAndSchemeDoesNotRenderPort()

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

Definition at line 207 of file UriTest.php.

◆ standardSchemePortCombinationsDataProvider()

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

Definition at line 559 of file UriTest.php.

◆ stringRepresentationOfAbsoluteUriWithNoPathSetsAnEmptyPath()

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

Definition at line 398 of file UriTest.php.

◆ stringRepresentationOfOriginFormWithNoPathRetainsEmptyPath()

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

Definition at line 416 of file UriTest.php.

◆ validPortsDataProvider()

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

Definition at line 116 of file UriTest.php.

◆ withEmptySchemeReturnsNewInstanceWithAbsoluteUri()

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

Definition at line 516 of file UriTest.php.

◆ withFragmentReturnsNewInstanceWithProvidedFragment()

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

Definition at line 343 of file UriTest.php.

◆ withFragmentStripsFragmentPrefixIfPresent()

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

Definition at line 549 of file UriTest.php.

◆ withHostReturnsNewInstanceWithProvidedHost()

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

Definition at line 92 of file UriTest.php.

◆ withPathIsNotPrefixedWithSlashIfSetWithoutOne()

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

Definition at line 506 of file UriTest.php.

◆ withPathNotSlashPrefixedIsEmittedWithSlashDelimiterWhenUriIsCastToString()

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

Definition at line 529 of file UriTest.php.

◆ withPathRaisesExceptionForInvalidPaths()

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

@dataProvider invalidPathsDataProvider

Test:

Definition at line 261 of file UriTest.php.

◆ withPathRaisesExceptionForInvalidPathsWithFragment()

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

Definition at line 283 of file UriTest.php.

◆ withPathRaisesExceptionForInvalidPathsWithQuery()

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

Definition at line 272 of file UriTest.php.

◆ withPathReturnsNewInstanceWithProvidedPath()

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

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

◆ withPortAndNullValueReturnsInstanceWithProvidedPort()

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

Definition at line 104 of file UriTest.php.

◆ withPortRaisesExceptionForInvalidPortsByRange()

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

@dataProvider invalidPortsDataProviderRange

Test:

Definition at line 196 of file UriTest.php.

◆ withPortRaisesExceptionForInvalidPortsByType()

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

@dataProvider invalidPortsDataProviderType

Test:

Definition at line 157 of file UriTest.php.

◆ withPortReturnsNewInstanceWithProvidedPort()

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

@dataProvider validPortsDataProvider

Test:

Definition at line 128 of file UriTest.php.

◆ withQueryRaisesExceptionForInvalidQueryStringsByFragment()

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

Definition at line 332 of file UriTest.php.

◆ withQueryRaisesExceptionForInvalidQueryStringsByType()

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

@dataProvider invalidQueryStringsDataProvider

Test:

Definition at line 321 of file UriTest.php.

◆ withQueryReturnsNewInstanceWithProvidedQuery()

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

Definition at line 294 of file UriTest.php.

◆ withQueryStripsQueryPrefixIfPresent()

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

Definition at line 539 of file UriTest.php.

◆ withSchemeReturnsNewInstanceWithNewScheme()

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

Definition at line 56 of file UriTest.php.

◆ withSchemeStripsOffDelimiter()

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

Definition at line 459 of file UriTest.php.

◆ withSchemeUsingUnsupportedSchemeRaisesAnException()

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

@dataProvider invalidSchemesDataProvider

Test:

Definition at line 495 of file UriTest.php.

◆ withUserInfoReturnsNewInstanceWithProvidedUser()

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

Definition at line 68 of file UriTest.php.

◆ withUserInfoReturnsNewInstanceWithProvidedUserAndPassword()

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

Definition at line 80 of file UriTest.php.