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

Public Member Functions

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

Protected Member Functions

 matches ($other)
 
 fail ($other, $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure=null)
 
 additionalFailureDescription ($other)
 
 failureDescription ($other)
 

Protected Attributes

 $exporter
 

Detailed Description

Abstract base class for constraints which can be applied to any value.

Since
Interface available since Release 3.0.0

Member Function Documentation

PHPUnit_Framework_Constraint::additionalFailureDescription (   $other)
protected

Return additional failure description where needed

The function can be overridden to provide additional failure information like a diff

Parameters
mixed$otherEvaluated value or object.
Returns
string
PHPUnit_Framework_Constraint::count ( )

Counts the number of constraint elements.

Returns
int
Since
Method available since Release 3.4.0

Implements Countable.

PHPUnit_Framework_Constraint::evaluate (   $other,
  $description = '',
  $returnResult = false 
)

Evaluates the constraint for parameter $other

If $returnResult is set to false (the default), an exception is thrown in case of a failure. null is returned otherwise.

If $returnResult is true, the result of the evaluation is returned as a boolean value instead: true in case of success, false in case of a failure.

Parameters
mixed$otherValue or object to evaluate.
string$descriptionAdditional information about the test
bool$returnResultWhether to return a result or throw an exception
Returns
mixed
Exceptions
PHPUnit_Framework_ExpectationFailedException
PHPUnit_Framework_Constraint::fail (   $other,
  $description,
SebastianBergmann\Comparator\ComparisonFailure  $comparisonFailure = null 
)
protected

Throws an exception for the given compared value and test description

Parameters
mixed$otherEvaluated value or object.
string$descriptionAdditional information about the test
SebastianBergmann\Comparator\ComparisonFailure$comparisonFailure
Exceptions
PHPUnit_Framework_ExpectationFailedException
PHPUnit_Framework_Constraint::failureDescription (   $other)
protected

Returns the description of the failure

The beginning of failure messages is "Failed asserting that" in most cases. This method should return the second part of that sentence.

To provide additional failure information additionalFailureDescription can be used.

Parameters
mixed$otherEvaluated value or object.
Returns
string
PHPUnit_Framework_Constraint::matches (   $other)
protected

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

This method can be overridden to implement the evaluation algorithm.

Parameters
mixed$otherValue or object to evaluate.
Returns
bool

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