PHP Класс PHPUnit_Framework_Constraint, phpunit

Автор: Sebastian Bergmann ([email protected])
Наследование: implements Countable, implements PHPUnit_Framework_SelfDescribing
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$exporter

Открытые методы

Метод Описание
__construct ( )
count ( ) : integer Counts the number of constraint elements.
evaluate ( mixed $other, string $description = '', boolean $returnResult = false ) : mixed Evaluates the constraint for parameter $other

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

public __construct ( )

additionalFailureDescription() защищенный Метод

The function can be overridden to provide additional failure information like a diff
protected additionalFailureDescription ( mixed $other ) : string
$other mixed Evaluated value or object.
Результат string

count() публичный Метод

Counts the number of constraint elements.
public count ( ) : integer
Результат integer

evaluate() публичный Метод

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
Результат mixed

fail() защищенный Метод

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() защищенный Метод

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.
Результат string

matches() защищенный Метод

This method can be overridden to implement the evaluation algorithm.
protected matches ( mixed $other ) : boolean
$other mixed Value or object to evaluate.
Результат boolean

Описание свойств

$exporter защищенное свойство

protected $exporter