PhpCommon\Comparison\Tests\Comparator\CallbackComparator
- ✓ The compare() method delegates calls to the callback function
PhpCommon\Comparison\Tests\Equivalence\GenericEquivalence
- ✓ The equivalent() method throws an exception if the given value does not match the expected type
- ✓ The equivalent() method delegates the comparison of strings to the equivalentString() method
- ✓ The equivalent() method delegates the comparison of integer numbers to the equivalentInteger() method
- ✓ The equivalent() method delegates the comparison of floating-point numbers to the equivalentFloat() method
- ✓ The equivalent() method delegates the comparison of objects to the equivalentObject() method
- ✓ The equivalent() method delegates the comparison of resources to the equivalentResource() method
- ✓ The equivalent() method delegates the comparison of boolean values to the equivalentBoolean() method
- ✓ The equivalent() method delegates the comparison of NULL values to the equivalentNull() method
- ✓ The equivalent() method delegates the comparison of arrays to the equivalentArray() method
PhpCommon\Comparison\Tests\Hasher\DateTimeHasher
- ✓ The equals() method returns true if instances are of the same class
- ✓ The equals() method returns false if instances are of different classes
- ✓ The equivalent() method returns true if DateTime instances have the same date, time and timezone
- ✓ The equivalent() method returns false if DateTime instances have different date, time or timezone
- ✓ The equivalent() method throws an exception if the left-hand value does not implement DateTimeInterface
- ✓ The equivalent() produces the same hash-code for equivalent dates
PhpCommon\Comparison\Tests\Hasher\GenericHasher
- ✓ The hash() method throws an exception if the given value does not match the expected type
- ✓ The hash() method delegates hashing of strings to the hashString() method
- ✓ The hash() method delegates hashing of integer numbers to the hashInteger() method
- ✓ The hash() method delegates hashing of floating-point numbers to the hashFloat() method
- ✓ The hash() method delegates hashing of objects to the hashObject() method
- ✓ The hash() method delegates hashing of resources to the hashResource() method
- ✓ The hash() method delegates hashing of boolean values to the hashBoolean() method
- ✓ The hash() method delegates hashing of NULL values to the hashNull() method
PhpCommon\Comparison\Tests\Equivalence\IdentityHasher
- ✓ The equals() method returns true if instances are of the same class
- ✓ The equals() method returns false if instances are of different classes
- ✓ The equivalent() method returns true if values are identical
- ✓ The equivalent() method returns false if values are not identical
- ✓ The equivalent() method is transitive
- ✓ The equivalent() method is reflexive
- ✓ The equivalent() method is symmetric
- ✓ The equivalent() produces the same hash-code for equivalent values
PhpCommon\Comparison\Tests\Hasher\ValueHasher
- ✓ The equals() method returns true if instances are of the same class and are equally configured
- ✓ The equals() method returns false if instances are of different classes or are not equally configured
- ✓ The equals() method is transitive
- ✓ The equivalent() method returns true if values are considered equivalent
- ✓ The equivalent() method returns false if values are not considered equivalent
- ✓ The equivalent() method is transitive
- ✓ The equivalent() method is reflexive
- ✓ The equivalent() method is symmetric
- ✓ The equivalent() delegates the comparison between Equatable objects to the objects being compared
- ✓ The equivalent() returns false if Equatable objects are of different types
- ✓ The equivalent() compares objects for identity by default
- ✓ The equivalent() throws an exception if an object is Equatable but not Hashable
- ✓ The equivalent() produces the same hash-code for equivalent values
- ✓ Allows an external Equivalence to be specified for comparing objects of a particular class
- ✓ Ensures that an external Equivalence specified for a class also applies to its subclasses
- ✓ Allows an external Hasher to be specified for hashing objects of a particular class
- ✓ Ensures that an external Hasher specified for a class also applies to its subclasses
PhpCommon\Comparison\Tests\IncomparableException
- ✓ The forType() method creates an exception with a pre-formatted message for incomparable types
- ✓ The forType() uses the fully qualified name of the class for identifying objects in the message