Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Response header PHPUnit Constraint
ASSERT_RESPONSE_CODE = 'assertResponseCode'
ASSERT_HEADER = 'assertHeader'
ASSERT_HEADER_CONTAINS = 'assertHeaderContains'
ASSERT_HEADER_REGEX = 'assertHeaderRegex'
string $_assertType = 'null'
Current assertion type
array $_assertTypes = 'array'
Available assertion types
int $_code = '200'
string $_header = 'null'
string $_match = 'null'
bool $_negate = 'false'
Whether or not assertion is negated
__construct(
)
:
void
Constructor; setup constraint state
_code(
Zend_Controller_Response_Abstract $response, int $code
)
:
bool
Compare response code for positive match
_getCode(
Zend_Controller_Response_Abstract $response
)
:
int
Retrieve response code
_getHeader(
Zend_Controller_Response_Abstract $response, string $header
)
:
string|null
Retrieve response header
_header(
Zend_Controller_Response_Abstract $response, string $header
)
:
bool
Positive check for response header presence
_headerContains(
Zend_Controller_Response_Abstract $response, string $header, string $match
)
:
bool
Positive check for header contents matching pattern
_headerRegex(
Zend_Controller_Response_Abstract $response, string $header, string $pattern
)
:
bool
Positive check for header contents matching regex
_notCode(
Zend_Controller_Response_Abstract $response, int $code
)
:
bool
Compare response code for negative match
_notHeader(
Zend_Controller_Response_Abstract $response, string $header
)
:
bool
Negative check for response header presence
_notHeaderContains(
Zend_Controller_Response_Abstract $response, string $header, string $match
)
:
bool
Negative check for header contents matching pattern
_notHeaderRegex(
Zend_Controller_Response_Abstract $response, string $header, string $pattern
)
:
bool
Negative check for header contents matching regex
evaluate(
Zend_Controller_Response_Abstract $other, null|string $assertType
=
null
)
:
bool
Evaluate an object to see if it fits the constraints
fail(
mixed $other, string $description, bool $not
=
false
)
:
void
Report Failure
setNegate(
bool $flag
=
true
)
:
void
Indicate negative match
toString(
)
:
string
Complete implementation