Moodle APIs 4.1
Moodle 4.1.9+ (Build: 20240402)
Public Member Functions | Protected Attributes | List of all members
phpunit_constraint_object_is_equal_with_exceptions Class Reference
Inheritance diagram for phpunit_constraint_object_is_equal_with_exceptions:

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 ()
 

Protected Attributes

mixed $capturedvalue
 $value Need to keep it here because it became private for PHPUnit 7.x and up
 
PHPUnit Framework Constraint IsEqual $isequal
 $isequal original constraint to be used internally.
 
array $keys = array()
 $keys The list of exceptions.
 

Member Function Documentation

◆ add_exception()

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.

Parameters
string$keyThe key to except.
string$comparatorThe assertion to use.

◆ evaluate()

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.

Parameters
mixed$otherValue or object to evaluate.
string$descriptionAdditional information about the test
bool$shouldreturnesultWhether to return a result or throw an exception
Return values
mixed
Exceptions
PHPUnit::Framework::ExpectationFailedException

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