API Documentation

Test/PHPUnit/Constraint/ResponseHeader.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Test
subpackage
PHPUnit
version
$Id: ResponseHeader.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Test_PHPUnit_Constraint_ResponseHeader

Description

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.

Zend_Test_PHPUnit_Constraint_ResponseHeader

Extends from
PHPUnit_Framework_Constraint
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Test
subpackage
PHPUnit
uses
PHPUnit_Framework_Constraint
Constants
ASSERT_RESPONSE_CODE
ASSERT_HEADER
ASSERT_HEADER_CONTAINS
ASSERT_HEADER_REGEX
Properties
$_assertType
$_assertTypes
$_code
$_header
$_match
$_negate
Methods
__construct
setNegate
evaluate
fail
toString
_code
_notCode
_getCode
_header
_notHeader
_getHeader
_headerContains
_notHeaderContains
_headerRegex
_notHeaderRegex

Description

Response header PHPUnit Constraint

Constants

ASSERT_RESPONSE_CODE

 ASSERT_RESPONSE_CODE = 'assertResponseCode'

Details

value
assertResponseCode

ASSERT_HEADER

 ASSERT_HEADER = 'assertHeader'

Details

value
assertHeader

ASSERT_HEADER_CONTAINS

 ASSERT_HEADER_CONTAINS = 'assertHeaderContains'

Details

value
assertHeaderContains

ASSERT_HEADER_REGEX

 ASSERT_HEADER_REGEX = 'assertHeaderRegex'

Details

value
assertHeaderRegex

Properties

$_assertType

string $_assertType = 'null'

Current assertion type

Details

$_assertType
string
visibility
protected
default
null
final
false
static
false

$_assertTypes

array $_assertTypes = 'array'

Available assertion types

Details

$_assertTypes
array
visibility
protected
default
array
final
false
static
false

$_code

int $_code = '200'

Details

$_code
int
Response code
visibility
protected
default
200
final
false
static
false

$_header

string $_header = 'null'

Details

$_header
string
Header
visibility
protected
default
null
final
false
static
false

$_match

string $_match = 'null'

Details

$_match
string
pattern against which to compare header content
visibility
protected
default
null
final
false
static
false

$_negate

bool $_negate = 'false'

Whether or not assertion is negated

Details

$_negate
bool
visibility
protected
default
false
final
false
static
false

Methods

__construct

__construct( ) : void

Constructor; setup constraint state

Details
visibility
public
final
false
static
false

_code

_code( Zend_Controller_Response_Abstract $response, int $code ) : bool

Compare response code for positive match

Arguments
$response
Zend_Controller_Response_Abstract
$code
int
Output
bool
Details
visibility
protected
final
false
static
false

_getCode

_getCode( Zend_Controller_Response_Abstract $response ) : int

Retrieve response code

Arguments
$response
Zend_Controller_Response_Abstract
Output
int
Details
visibility
protected
final
false
static
false

_getHeader

_getHeader( Zend_Controller_Response_Abstract $response, string $header ) : string|null

Retrieve response header

Arguments
$response
Zend_Controller_Response_Abstract
$header
string
Output
string|null
Details
visibility
protected
final
false
static
false

_header

_header( Zend_Controller_Response_Abstract $response, string $header ) : bool

Positive check for response header presence

Arguments
$response
Zend_Controller_Response_Abstract
$header
string
Output
bool
Details
visibility
protected
final
false
static
false

_headerContains

_headerContains( Zend_Controller_Response_Abstract $response, string $header, string $match ) : bool

Positive check for header contents matching pattern

Arguments
$response
Zend_Controller_Response_Abstract
$header
string
$match
string
Output
bool
Details
visibility
protected
final
false
static
false

_headerRegex

_headerRegex( Zend_Controller_Response_Abstract $response, string $header, string $pattern ) : bool

Positive check for header contents matching regex

Arguments
$response
Zend_Controller_Response_Abstract
$header
string
$pattern
string
Output
bool
Details
visibility
protected
final
false
static
false

_notCode

_notCode( Zend_Controller_Response_Abstract $response, int $code ) : bool

Compare response code for negative match

Arguments
$response
Zend_Controller_Response_Abstract
$code
int
Output
bool
Details
visibility
protected
final
false
static
false

_notHeader

_notHeader( Zend_Controller_Response_Abstract $response, string $header ) : bool

Negative check for response header presence

Arguments
$response
Zend_Controller_Response_Abstract
$header
string
Output
bool
Details
visibility
protected
final
false
static
false

_notHeaderContains

_notHeaderContains( Zend_Controller_Response_Abstract $response, string $header, string $match ) : bool

Negative check for header contents matching pattern

Arguments
$response
Zend_Controller_Response_Abstract
$header
string
$match
string
Output
bool
Details
visibility
protected
final
false
static
false

_notHeaderRegex

_notHeaderRegex( Zend_Controller_Response_Abstract $response, string $header, string $pattern ) : bool

Negative check for header contents matching regex

Arguments
$response
Zend_Controller_Response_Abstract
$header
string
$pattern
string
Output
bool
Details
visibility
protected
final
false
static
false

evaluate

evaluate( Zend_Controller_Response_Abstract $other, null|string $assertType = null ) : bool

Evaluate an object to see if it fits the constraints

Arguments
$other
Zend_Controller_Response_Abstract
String to examine
$assertType
nullstring
Assertion type
Output
bool
Details
visibility
public
final
false
static
false

fail

fail( mixed $other, string $description, bool $not = false ) : void

Report Failure

Arguments
$other
mixed
$description
string
Additional message to display
$not
bool
Details
visibility
public
final
false
static
false
see
PHPUnit_Framework_Constraint for implementation details
throws

setNegate

setNegate( bool $flag = true ) : void

Indicate negative match

Arguments
$flag
bool
Details
visibility
public
final
false
static
false

toString

toString( ) : string

Complete implementation

Output
string
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.