TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
UriTest Class Reference
Inheritance diagram for UriTest:
UnitTestCase BaseTestCase

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from UnitTestCase
 tearDown ()
 
- Protected Member Functions inherited from BaseTestCase
 getAccessibleMock ($originalClassName, $methods=[], array $arguments=[], $mockClassName= '', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true)
 
 getAccessibleMockForAbstractClass ($originalClassName, array $arguments=[], $mockClassName= '', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true, $mockedMethods=[])
 
 buildAccessibleProxy ($className)
 
 callInaccessibleMethod ($object, $name,...$arguments)
 
 inject ($target, $name, $dependency)
 
 getUniqueId ($prefix= '')
 
- Protected Attributes inherited from UnitTestCase
 $backupGlobalsBlacklist = ['TYPO3_LOADED_EXT']
 
 $testFilesToDelete = []
 
- Protected Attributes inherited from BaseTestCase
 $backupGlobals = true
 
 $backupStaticAttributes = false
 

Detailed Description

Testcase for

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

Definition at line 24 of file UriTest.php.

Member Function Documentation

authorityInfoDataProvider ( )
Returns
array

Definition at line 316 of file UriTest.php.

canEmitOriginFormUrl ( )
Test:

Definition at line 339 of file UriTest.php.

canSerializeToString ( )
Test:

Definition at line 45 of file UriTest.php.

constructorRaisesExceptionForNonStringURI (   $uri)

invalidConstructorUrisDataProvider

Definition at line 402 of file UriTest.php.

constructorRaisesExceptionForSeriouslyMalformedURI ( )
Test:

Definition at line 411 of file UriTest.php.

constructorSetsAllProperties ( )
Test:

Definition at line 29 of file UriTest.php.

constructWithUnsupportedSchemeRaisesAnException (   $scheme)

invalidSchemesDataProvider

Test:

Definition at line 445 of file UriTest.php.

getAuthorityOmitsPortForStandardSchemePortCombinations (   $scheme,
  $port 
)

standardSchemePortCombinationsDataProvider

Test:

Definition at line 519 of file UriTest.php.

getAuthorityReturnsExpectedValues (   $url,
  $expected 
)

authorityInfoDataProvider

Test:

Definition at line 330 of file UriTest.php.

getFragmentIsNotDoubleEncoded ( )
Test:

Definition at line 595 of file UriTest.php.

getFragmentIsProperlyEncoded ( )
Test:

Definition at line 585 of file UriTest.php.

getPathDoesNotBecomeDoubleEncoded ( )
Test:

Definition at line 541 of file UriTest.php.

getPathIsProperlyEncoded ( )
Test:

Definition at line 531 of file UriTest.php.

getPathOnOriginFormRemainsAnEmptyPath ( )
Test:

Definition at line 368 of file UriTest.php.

getQueryIsNotDoubleEncoded (   $query,
  $expected 
)

queryStringsForEncodingDataProvider

Test:

Definition at line 576 of file UriTest.php.

getQueryIsProperlyEncoded (   $query,
  $expected 
)

queryStringsForEncodingDataProvider

Test:

Definition at line 566 of file UriTest.php.

invalidConstructorUrisDataProvider ( )
Returns
array

Definition at line 386 of file UriTest.php.

invalidPathsDataProvider ( )
Returns
array

Definition at line 207 of file UriTest.php.

invalidPortsDataProviderRange ( )
Returns
array

Definition at line 156 of file UriTest.php.

invalidPortsDataProviderType ( )
Returns
array

Definition at line 130 of file UriTest.php.

invalidQueryStringsDataProvider ( )
Returns
array

Definition at line 267 of file UriTest.php.

invalidSchemesDataProvider ( )
Returns
array

Definition at line 430 of file UriTest.php.

queryStringsForEncodingDataProvider ( )
Returns
array

Definition at line 551 of file UriTest.php.

settingEmptyPathOnAbsoluteUriReturnsAnEmptyPath ( )
Test:

Definition at line 349 of file UriTest.php.

standardSchemePortCombinationsDataProvider ( )
Returns
array

Definition at line 507 of file UriTest.php.

stringRepresentationOfAbsoluteUriWithNoPathSetsAnEmptyPath ( )
Test:

Definition at line 359 of file UriTest.php.

stringRepresentationOfOriginFormWithNoPathRetainsEmptyPath ( )
Test:

Definition at line 377 of file UriTest.php.

validPortsDataProvider ( )
Returns
array

Definition at line 103 of file UriTest.php.

withFragmentReturnsNewInstanceWithProvidedFragment ( )
Test:

Definition at line 304 of file UriTest.php.

withFragmentStripsFragmentPrefixIfPresent ( )
Test:

Definition at line 497 of file UriTest.php.

withHostReturnsNewInstanceWithProvidedHost ( )
Test:

Definition at line 91 of file UriTest.php.

withPathIsNotPrefixedWithSlashIfSetWithoutOne ( )
Test:

Definition at line 467 of file UriTest.php.

withPathNotSlashPrefixedIsEmittedWithSlashDelimiterWhenUriIsCastToString ( )
Test:

Definition at line 477 of file UriTest.php.

withPathRaisesExceptionForInvalidPaths (   $path)

invalidPathsDataProvider

Test:

Definition at line 222 of file UriTest.php.

withPathRaisesExceptionForInvalidPathsWithFragment ( )
Test:

Definition at line 244 of file UriTest.php.

withPathRaisesExceptionForInvalidPathsWithQuery ( )
Test:

Definition at line 233 of file UriTest.php.

withPathReturnsNewInstanceWithProvidedPath ( )
Test:

Definition at line 195 of file UriTest.php.

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 172 of file UriTest.php.

withPortRaisesExceptionForInvalidPortsByRange (   $port)

invalidPortsDataProviderRange

Test:

Definition at line 184 of file UriTest.php.

withPortRaisesExceptionForInvalidPortsByType (   $port)

invalidPortsDataProviderType

Test:

Definition at line 145 of file UriTest.php.

withPortReturnsNewInstanceWithProvidedPort (   $port)

validPortsDataProvider

Test:

Definition at line 115 of file UriTest.php.

withQueryRaisesExceptionForInvalidQueryStringsByFragment ( )
Test:

Definition at line 293 of file UriTest.php.

withQueryRaisesExceptionForInvalidQueryStringsByType (   $query)

invalidQueryStringsDataProvider

Test:

Definition at line 282 of file UriTest.php.

withQueryReturnsNewInstanceWithProvidedQuery ( )
Test:

Definition at line 255 of file UriTest.php.

withQueryStripsQueryPrefixIfPresent ( )
Test:

Definition at line 487 of file UriTest.php.

withSchemeReturnsNewInstanceWithNewScheme ( )
Test:

Definition at line 55 of file UriTest.php.

withSchemeStripsOffDelimiter ( )
Test:

Definition at line 420 of file UriTest.php.

withSchemeUsingUnsupportedSchemeRaisesAnException (   $scheme)

invalidSchemesDataProvider

Test:

Definition at line 456 of file UriTest.php.

withUserInfoReturnsNewInstanceWithProvidedUser ( )
Test:

Definition at line 67 of file UriTest.php.

withUserInfoReturnsNewInstanceWithProvidedUserAndPassword ( )
Test:

Definition at line 79 of file UriTest.php.