Class HeaderComparison
Class used to compare HTTP headers using a custom DSL
Methods summary
public
array|boolean
|
#
compare( array $filteredHeaders, array $actualHeaders )
Compare HTTP headers and use special markup to filter values A header
prefixed with '!' means it must not exist A header prefixed with '_' means it
must be ignored A header value of '*' means anything after the * will be
ignored
Compare HTTP headers and use special markup to filter values A header
prefixed with '!' means it must not exist A header prefixed with '_' means it
must be ignored A header value of '*' means anything after the * will be
ignored
Parameters
- $filteredHeaders
array $filteredHeaders Array of special headers
- $actualHeaders
array $actualHeaders Array of headers to check against
Returns
array|boolean Returns an array of the differences or FALSE if none
|
public
array|boolean
|
#
compareArray( array $expected, array|Guzzle\Common\Collection $actual, array $ignore = array(), array $absent = array() )
Check if an array of HTTP headers matches another array of HTTP headers while
taking * into account as a wildcard
Check if an array of HTTP headers matches another array of HTTP headers while
taking * into account as a wildcard
Parameters
- $expected
array $expected Expected HTTP headers (allows wildcard values)
- $actual
array|Guzzle\Common\Collection $actual Actual HTTP header array
- $ignore
array $ignore Headers to ignore from the comparison
- $absent
array $absent Array of headers that must not be present
Returns
array|boolean Returns an array of the differences or FALSE if none
|
protected
boolean
|
#
hasKey( string $key, array $array )
Case insensitive check if an array have a key
Case insensitive check if an array have a key
Parameters
- $key
string $key Key to check
- $array
array $array Array to check
Returns
boolean
|