\Guzzle\Tests\Http\MessageHeaderComparison

Class used to compare HTTP headers using a custom DSL

Summary

Methods
Properties
Constants
compare()
compareArray()
No public properties found
No constants found
hasKey()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

compare()

compare(array  $filteredHeaders, array  $actualHeaders) : array|boolean

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

array $filteredHeaders

Array of special headers

array $actualHeaders

Array of headers to check against

Returns

array|boolean —

Returns an array of the differences or FALSE if none

compareArray()

compareArray(array  $expected, array|\Guzzle\Common\Collection  $actual, array  $ignore = array(), array  $absent = array()) : array|boolean

Check if an array of HTTP headers matches another array of HTTP headers while taking * into account as a wildcard

Parameters

array $expected

Expected HTTP headers (allows wildcard values)

array|\Guzzle\Common\Collection $actual

Actual HTTP header array

array $ignore

Headers to ignore from the comparison

array $absent

Array of headers that must not be present

Returns

array|boolean —

Returns an array of the differences or FALSE if none

hasKey()

hasKey(string  $key, array  $array) : boolean

Case insensitive check if an array have a key

Parameters

string $key

Key to check

array $array

Array to check

Returns

boolean