PHP Class PHPUnit_Framework_Constraint, phpunit

Author: Sebastian Bergmann ([email protected])
Inheritance: implements Countable, implements PHPUnit_Framework_SelfDescribing
Afficher le fichier Open project: sebastianbergmann/phpunit Class Usage Examples

Protected Properties

Свойство Type Description
$exporter

Méthodes publiques

Méthode Description
__construct ( )
count ( ) : integer Counts the number of constraint elements.
evaluate ( mixed $other, string $description = '', boolean $returnResult = false ) : mixed Evaluates the constraint for parameter $other

Méthodes protégées

Méthode Description
additionalFailureDescription ( mixed $other ) : string Return additional failure description where needed
fail ( mixed $other, string $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = null ) Throws an exception for the given compared value and test description
failureDescription ( mixed $other ) : string Returns the description of the failure
matches ( mixed $other ) : boolean Evaluates the constraint for parameter $other. Returns true if the constraint is met, false otherwise.

Method Details

__construct() public méthode

public __construct ( )

additionalFailureDescription() protected méthode

The function can be overridden to provide additional failure information like a diff
protected additionalFailureDescription ( mixed $other ) : string
$other mixed Evaluated value or object.
Résultat string

count() public méthode

Counts the number of constraint elements.
public count ( ) : integer
Résultat integer

evaluate() public méthode

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.
public evaluate ( mixed $other, string $description = '', boolean $returnResult = false ) : mixed
$other mixed Value or object to evaluate.
$description string Additional information about the test
$returnResult boolean Whether to return a result or throw an exception
Résultat mixed

fail() protected méthode

Throws an exception for the given compared value and test description
protected fail ( mixed $other, string $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = null )
$other mixed Evaluated value or object.
$description string Additional information about the test
$comparisonFailure SebastianBergmann\Comparator\ComparisonFailure

failureDescription() protected méthode

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.
protected failureDescription ( mixed $other ) : string
$other mixed Evaluated value or object.
Résultat string

matches() protected méthode

This method can be overridden to implement the evaluation algorithm.
protected matches ( mixed $other ) : boolean
$other mixed Value or object to evaluate.
Résultat boolean

Property Details

$exporter protected_oe property

protected $exporter