Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Constraint that checks a simple object with an isEqual constrain, allowing for exceptions to be made for some fields. More...
Public Member Functions | |
__construct ($value, float $delta=0.0, int $maxDepth=10, bool $canonicalize=false, bool $ignoreCase=false) | |
Override constructor to capture value. | |
add_exception ($key, $comparator) | |
Add an exception for the named key to use a different comparison method. | |
evaluate ($other, string $description='', bool $shouldreturnesult=false) | |
Evaluates the constraint for parameter $other. | |
toString () | |
Constraint that checks a simple object with an isEqual constrain, allowing for exceptions to be made for some fields.
phpunit_constraint_object_is_equal_with_exceptions::add_exception | ( | $key, | |
$comparator ) |
Add an exception for the named key to use a different comparison method.
Any assertion provided by PHPUnit\Framework\Assert is acceptable.
string | $key | The key to except. |
string | $comparator | The assertion to use. |
phpunit_constraint_object_is_equal_with_exceptions::evaluate | ( | $other, | |
string | $description = '', | ||
bool | $shouldreturnesult = false ) |
Evaluates the constraint for parameter $other.
If $shouldreturnesult is set to false (the default), an exception is thrown in case of a failure. null is returned otherwise.
If $shouldreturnesult 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 | $shouldreturnesult | Whether to return a result or throw an exception |
mixed |
PHPUnit\Framework\ExpectationFailedException |