BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
PHPUnit_Framework_Constraint_IsType Class Reference
Inheritance diagram for PHPUnit_Framework_Constraint_IsType:
Collaboration diagram for PHPUnit_Framework_Constraint_IsType:

Public Member Functions

 __construct ($type)
 
 toString ()
 
- Public Member Functions inherited from PHPUnit_Framework_Constraint
 evaluate ($other, $description= '', $returnResult=false)
 
 count ()
 

Public Attributes

const TYPE_ARRAY = 'array'
 
const TYPE_BOOL = 'bool'
 
const TYPE_FLOAT = 'float'
 
const TYPE_INT = 'int'
 
const TYPE_NULL = 'null'
 
const TYPE_NUMERIC = 'numeric'
 
const TYPE_OBJECT = 'object'
 
const TYPE_RESOURCE = 'resource'
 
const TYPE_STRING = 'string'
 
const TYPE_SCALAR = 'scalar'
 
const TYPE_CALLABLE = 'callable'
 

Protected Member Functions

 matches ($other)
 
- Protected Member Functions inherited from PHPUnit_Framework_Constraint
 matches ($other)
 
 fail ($other, $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure=null)
 
 additionalFailureDescription ($other)
 
 failureDescription ($other)
 

Protected Attributes

 $types
 
 $type
 
- Protected Attributes inherited from PHPUnit_Framework_Constraint
 $exporter
 

Detailed Description

Constraint that asserts that the value it is evaluated for is of a specified type.

The expected value is passed in the constructor.

Since
Class available since Release 3.0.0

Constructor & Destructor Documentation

PHPUnit_Framework_Constraint_IsType::__construct (   $type)
Parameters
string$type
Exceptions
PHPUnit_Framework_Exception

Member Function Documentation

PHPUnit_Framework_Constraint_IsType::matches (   $other)
protected

Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.

Parameters
mixed$otherValue or object to evaluate.
Returns
bool
PHPUnit_Framework_Constraint_IsType::toString ( )

Returns a string representation of the constraint.

Returns
string

Implements PHPUnit_Framework_SelfDescribing.

Member Data Documentation

PHPUnit_Framework_Constraint_IsType::$types
protected
Initial value:
= array(
'array' => true,
'boolean' => true,
'bool' => true,
'double' => true,
'float' => true,
'integer' => true,
'int' => true,
'null' => true,
'numeric' => true,
'object' => true,
'real' => true,
'resource' => true,
'string' => true,
'scalar' => true,
'callable' => true
)

The documentation for this class was generated from the following file: