Documentation

UriTest extends TestCase
in package

Tags
see
https://github.com/guzzle/psr7/blob/45b30f99ac27b5ca93cb4831afe16285f57b8221/tests/UriTest.php
see
https://github.com/Nyholm/psr7/blob/fd12ffc87a1e4014b2a7485b88add81c96d105e8/tests/UriTest.php

Table of Contents

Methods

authorityProvider()  : array<string|int, mixed>
getInvalidUris()  : array<string|int, mixed>
getValidUris()  : array<string|int, mixed>
hostProvider()  : array<string|int, mixed>
testAddsSlashForRelativeUriStringWithHost()  : void
testAllowsForRelativeUri()  : void
testAuthorityWithUserInfoOrPortButWithoutHost()  : void
In RFC 8986 the host is optional and the authority can only consist of the user info and port.
testCanConstructFalseyUriParts()  : void
testCanParseFalseyUriParts()  : void
testCanTransformAndRetrievePartsIndividually()  : void
testDefaultReturnValuesOfGetters()  : void
testFileSchemeWithEmptyHostReconstruction()  : void
testFilterHostIPv6()  : void
testFromParts()  : void
testGetAuthority()  : void
If the port component is not set or is the standard port for the current scheme, it SHOULD NOT be included.
testGetHost()  : void
The value returned MUST be normalized to lowercase, per RFC 3986 Section 3.2.2.
testHostInUriDefaultsToLocalhost()  : void
testHostIsNormalizedToLowercase()  : void
testInternationalizedDomainName()  : void
testInvalidUrisThrowException()  : void
testIPv6Host()  : void
testParsesProvidedUri()  : void
testParseUriPortCanBeZero()  : mixed
testParseUriPortCannotBeNegative()  : void
testPathStartingWithTwoSlashes()  : void
testPortCanBeRemoved()  : void
testPortIsNullIfStandardPortForScheme()  : void
testPortIsReturnedIfSchemeUnknown()  : void
testPortMustBeValid()  : void
testRelativeUriWithPathBeginningWithColonSegmentIsInvalid()  : void
testRelativeUriWithPathHavingColonSegment()  : void
testSchemeIsNormalizedToLowercase()  : void
testStandardPortIsNullIfSchemeChanges()  : void
testSupportsUrlEncodedValues()  : void
testUriComponentsGetEncodedProperly()  : void
testValidUrisStayValid()  : void
testWithFragmentEncodesProperly()  : void
testWithPartSamePart()  : void
testWithPathEncodesProperly()  : void
testWithPortCannotBeNegative()  : void
testWithQueryEncodesProperly()  : void
uriComponentsEncodingProvider()  : array<string|int, mixed>

Methods

authorityProvider()

public static authorityProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>

getInvalidUris()

public static getInvalidUris() : array<string|int, mixed>
Return values
array<string|int, mixed>

getValidUris()

public static getValidUris() : array<string|int, mixed>
Return values
array<string|int, mixed>

hostProvider()

public static hostProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>

testAddsSlashForRelativeUriStringWithHost()

public testAddsSlashForRelativeUriStringWithHost() : void

testAllowsForRelativeUri()

public testAllowsForRelativeUri() : void

testAuthorityWithUserInfoOrPortButWithoutHost()

In RFC 8986 the host is optional and the authority can only consist of the user info and port.

public testAuthorityWithUserInfoOrPortButWithoutHost() : void

testCanConstructFalseyUriParts()

public testCanConstructFalseyUriParts() : void

testCanParseFalseyUriParts()

public testCanParseFalseyUriParts() : void

testCanTransformAndRetrievePartsIndividually()

public testCanTransformAndRetrievePartsIndividually() : void

testDefaultReturnValuesOfGetters()

public testDefaultReturnValuesOfGetters() : void

testFileSchemeWithEmptyHostReconstruction()

public testFileSchemeWithEmptyHostReconstruction() : void

testFilterHostIPv6()

public testFilterHostIPv6() : void

testFromParts()

public testFromParts(string $input) : void
Parameters
$input : string
Attributes
#[DataProvider]
'getValidUris'

testGetAuthority()

If the port component is not set or is the standard port for the current scheme, it SHOULD NOT be included.

public testGetAuthority(string $scheme, string $user, string $pass, string $host, int|null $port, string $authority) : void
Parameters
$scheme : string
$user : string
$pass : string
$host : string
$port : int|null
$authority : string
Attributes
#[DataProvider]
'authorityProvider'

testGetHost()

The value returned MUST be normalized to lowercase, per RFC 3986 Section 3.2.2.

public testGetHost(string $host, string $expected) : void
Parameters
$host : string
$expected : string
Attributes
#[DataProvider]
'hostProvider'

testHostInUriDefaultsToLocalhost()

public testHostInUriDefaultsToLocalhost() : void

testHostIsNormalizedToLowercase()

public testHostIsNormalizedToLowercase() : void

testInternationalizedDomainName()

public testInternationalizedDomainName() : void

testInvalidUrisThrowException()

public testInvalidUrisThrowException(string $invalidUri) : void
Parameters
$invalidUri : string
Attributes
#[DataProvider]
'getInvalidUris'

testIPv6Host()

public testIPv6Host() : void

testParsesProvidedUri()

public testParsesProvidedUri() : void

testParseUriPortCanBeZero()

public testParseUriPortCanBeZero() : mixed

testParseUriPortCannotBeNegative()

public testParseUriPortCannotBeNegative() : void

testPathStartingWithTwoSlashes()

public testPathStartingWithTwoSlashes() : void

testPortCanBeRemoved()

public testPortCanBeRemoved() : void

testPortIsNullIfStandardPortForScheme()

public testPortIsNullIfStandardPortForScheme() : void

testPortIsReturnedIfSchemeUnknown()

public testPortIsReturnedIfSchemeUnknown() : void

testPortMustBeValid()

public testPortMustBeValid() : void

testRelativeUriWithPathBeginningWithColonSegmentIsInvalid()

public testRelativeUriWithPathBeginningWithColonSegmentIsInvalid() : void

testRelativeUriWithPathHavingColonSegment()

public testRelativeUriWithPathHavingColonSegment() : void

testSchemeIsNormalizedToLowercase()

public testSchemeIsNormalizedToLowercase() : void

testStandardPortIsNullIfSchemeChanges()

public testStandardPortIsNullIfSchemeChanges() : void

testSupportsUrlEncodedValues()

public testSupportsUrlEncodedValues() : void

testUriComponentsGetEncodedProperly()

public testUriComponentsGetEncodedProperly(string $input, string $path, string $query, string $fragment, string $output) : void
Parameters
$input : string
$path : string
$query : string
$fragment : string
$output : string
Attributes
#[DataProvider]
'uriComponentsEncodingProvider'

testValidUrisStayValid()

public testValidUrisStayValid(string $input) : void
Parameters
$input : string
Attributes
#[DataProvider]
'getValidUris'

testWithFragmentEncodesProperly()

public testWithFragmentEncodesProperly() : void

testWithPartSamePart()

public testWithPartSamePart() : void

testWithPathEncodesProperly()

public testWithPathEncodesProperly() : void

testWithPortCannotBeNegative()

public testWithPortCannotBeNegative() : void

testWithQueryEncodesProperly()

public testWithQueryEncodesProperly() : void

uriComponentsEncodingProvider()

public static uriComponentsEncodingProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results