accepts()
accepts( $expected, $actual)
Parameters
$expected | ||
$actual |
Use this Comparator to get nice output when using PHPUnit assertEquals() with Enums.
Add this to your PHPUnit bootstrap PHP file:
\SebastianBergmann\Comparator\Factory::getInstance()->register(new \MyCLabs\Enum\PHPUnit\Comparator());
assertEquals(\MyCLabs\Enum\Enum $expected, \MyCLabs\Enum\Enum|null $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false) : void
\MyCLabs\Enum\Enum | $expected | |
\MyCLabs\Enum\Enum|null | $actual | |
$delta | ||
$canonicalize | ||
$ignoreCase |
formatEnum(\MyCLabs\Enum\Enum $enum = null)
\MyCLabs\Enum\Enum | $enum |