\MyCLabs\Enum\PHPUnitComparator

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

Summary

Methods
Properties
Constants
accepts()
assertEquals()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
formatEnum()
No private properties found
N/A

Methods

accepts()

accepts(mixed  $expected, mixed  $actual) : mixed

Parameters

mixed $expected
mixed $actual

Returns

mixed —

assertEquals()

assertEquals(\MyCLabs\Enum\Enum  $expected, \MyCLabs\Enum\Enum|null  $actual, mixed  $delta = 0.0, mixed  $canonicalize = false, mixed  $ignoreCase = false) : void

Parameters

\MyCLabs\Enum\Enum $expected
\MyCLabs\Enum\Enum|null $actual
mixed $delta
mixed $canonicalize
mixed $ignoreCase

formatEnum()

formatEnum(\MyCLabs\Enum\Enum  $enum = null) : mixed

Parameters

\MyCLabs\Enum\Enum $enum

Returns

mixed —