[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/phpunit/classes/ -> constraint_object_is_equal_with_exceptions.php (summary)

Constraint that checks a simple object with an isEqual constrain, allowing for exceptions to be made for some fields.

Copyright: 2015 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 86 lines (3 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

phpunit_constraint_object_is_equal_with_exceptions:: (2 methods):
  add_exception()
  evaluate()


Class: phpunit_constraint_object_is_equal_with_exceptions  - X-Ref

Constraint that checks a simple object with an isEqual constrain, allowing for exceptions to be made for some fields.

add_exception($key, $comparator)   X-Ref
Add an exception for the named key to use a different comparison
method. Any assertion provided by PHPUnit_Framework_Assert is
acceptable.

param: string $key The key to except.
param: string $comparator The assertion to use.

evaluate($other, $description = '', $shouldreturnesult = false)   X-Ref
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.

param: mixed    $other              Value or object to evaluate.
param: string   $description        Additional information about the test
param: bool     $shouldreturnesult  Whether to return a result or throw an exception
return: mixed



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1