15 final class Comparator extends \SebastianBergmann\Comparator\Comparator
17 public function accepts($expected, $actual)
19 return $expected instanceof
Enum && (
20 $actual instanceof
Enum || $actual === null
30 public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize =
false, $ignoreCase =
false)
32 if ($expected->equals($actual)) {
36 throw new ComparisonFailure(
42 'Failed asserting that two Enums are equal.' 52 return get_class($enum).
"::{$enum->getKey()}()";
assertEquals($expected, $actual, $delta=0.0, $canonicalize=false, $ignoreCase=false)
Use this Comparator to get nice output when using PHPUnit assertEquals() with Enums.
accepts($expected, $actual)
formatEnum(Enum $enum=null)