Lggr
|
Public Member Functions | |
evaluate ($other, $description='', $returnResult=false) | |
count () | |
![]() | |
toString () | |
Protected Member Functions | |
matches ($other) | |
fail ($other, $description, ComparisonFailure $comparisonFailure=null) | |
additionalFailureDescription ($other) | |
failureDescription ($other) | |
Protected Attributes | |
$exporter | |
Abstract base class for constraints which can be applied to any value.
|
protected |
Return additional failure description where needed
The function can be overridden to provide additional failure information like a diff
mixed | $other | Evaluated value or object. |
Reimplemented in PHPUnit\Framework\Constraint\StringMatchesFormatDescription.
PHPUnit\Framework\Constraint\Constraint::count | ( | ) |
Counts the number of constraint elements.
Reimplemented in PHPUnit\Framework\Constraint\LogicalNot, PHPUnit\Framework\Constraint\LogicalAnd, PHPUnit\Framework\Constraint\LogicalXor, PHPUnit\Framework\Constraint\LogicalOr, PHPUnit\Framework\Constraint\Composite, PHPUnit\Framework\Constraint\IsAnything, and CountConstraint.
PHPUnit\Framework\Constraint\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.
mixed | $other | Value or object to evaluate. |
string | $description | Additional information about the test |
bool | $returnResult | Whether to return a result or throw an exception |
ExpectationFailedException |
Reimplemented in PHPUnit\Framework\Constraint\LogicalNot, PHPUnit\Framework\Constraint\IsEqual, PHPUnit\Framework\Constraint\LogicalAnd, PHPUnit\Framework\Constraint\LogicalOr, PHPUnit\Framework\Constraint\LogicalXor, PHPUnit\Framework\Constraint\TraversableContainsOnly, PHPUnit\Framework\Constraint\IsIdentical, PHPUnit\Framework\Constraint\ArraySubset, PHPUnit\Framework\Constraint\Attribute, PHPUnit\Framework\Constraint\Composite, and PHPUnit\Framework\Constraint\IsAnything.
|
protected |
Throws an exception for the given compared value and test description
mixed | $other | Evaluated value or object. |
string | $description | Additional information about the test |
ComparisonFailure | $comparisonFailure |
ExpectationFailedException |
Reimplemented in PHPUnit\Framework\Constraint\JsonMatches.
|
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.
mixed | $other | Evaluated value or object. |
Reimplemented in PHPUnit\Framework\Constraint\LogicalNot, PHPUnit\Framework\Constraint\TraversableContains, PHPUnit\Framework\Constraint\Count, PHPUnit\Framework\Constraint\ArraySubset, PHPUnit\Framework\Constraint\IsIdentical, PHPUnit\Framework\Constraint\Attribute, PHPUnit\Framework\Constraint\ArrayHasKey, PHPUnit\Framework\Constraint\ClassHasAttribute, PHPUnit\Framework\Constraint\ExceptionMessageRegularExpression, PHPUnit\Framework\Constraint\IsInstanceOf, PHPUnit\Framework\Constraint\ExceptionMessage, PHPUnit\Framework\Constraint\IsEmpty, PHPUnit\Framework\Constraint\Exception, PHPUnit\Framework\Constraint\ExceptionCode, PHPUnit\Framework\Constraint\IsJson, PHPUnit\Framework\Constraint\DirectoryExists, PHPUnit\Framework\Constraint\FileExists, PHPUnit\Framework\Constraint\IsReadable, PHPUnit\Framework\Constraint\IsWritable, and PHPUnit\Framework\Constraint\StringMatchesFormatDescription.
|
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.
mixed | $other | Value or object to evaluate. |
Reimplemented in PHPUnit\Framework\Constraint\IsType, PHPUnit\Framework\Constraint\TraversableContains, PHPUnit\Framework\Constraint\StringContains, PHPUnit\Framework\Constraint\Callback, PHPUnit\Framework\Constraint\JsonMatches, PHPUnit\Framework\Constraint\ArrayHasKey, PHPUnit\Framework\Constraint\IsInstanceOf, PHPUnit\Framework\Constraint\RegularExpression, PHPUnit\Framework\Constraint\ClassHasAttribute, PHPUnit\Framework\Constraint\Count, PHPUnit\Framework\Constraint\GreaterThan, PHPUnit\Framework\Constraint\LessThan, PHPUnit\Framework\Constraint\StringEndsWith, PHPUnit\Framework\Constraint\StringStartsWith, PHPUnit\Framework\Constraint\Exception, PHPUnit\Framework\Constraint\ExceptionMessageRegularExpression, PHPUnit\Framework\Constraint\ExceptionCode, PHPUnit\Framework\Constraint\ExceptionMessage, PHPUnit\Framework\Constraint\ClassHasStaticAttribute, PHPUnit\Framework\Constraint\ObjectHasAttribute, PHPUnit\Framework\Constraint\DirectoryExists, PHPUnit\Framework\Constraint\FileExists, PHPUnit\Framework\Constraint\IsEmpty, PHPUnit\Framework\Constraint\IsReadable, PHPUnit\Framework\Constraint\IsWritable, PHPUnit\Framework\Constraint\IsFalse, PHPUnit\Framework\Constraint\IsFinite, PHPUnit\Framework\Constraint\IsInfinite, PHPUnit\Framework\Constraint\IsJson, PHPUnit\Framework\Constraint\IsNan, PHPUnit\Framework\Constraint\IsNull, PHPUnit\Framework\Constraint\IsTrue, CountConstraint, NamedConstraint, FalsyConstraint, and TruthyConstraint.