-
-
Notifications
You must be signed in to change notification settings - Fork 132
Add a comparator to help with writing tests #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
That sounds interesting! So to sum up to use it I would need to run this: \SebastianBergmann\Comparator\Factory::getInstance()->register(new \MyCLabs\Enum\PHPUnit\Comparator); I've heard of PHPUnit "extensions" that can be added to |
It looks like the Pretty CI is failed due to failed PSR-2 coding style check. The detailed log is available here. I think the coding style should be fixed :). |
This is weird because the failures on Maybe your branch is old, try rebasing your branch on master to have all the latest changes. And then there's still one fix to do in your new file indeed. |
That's only possible for test listeners, not for custom Comparators. |
Roger that! Thank you for the PR. |
I'll create a PR later to update the readme with the new functionality. |
Thanks! |
PHPUnit offers the ability to add custom comparators. In particular these offer the ability to add nice error messages:
This is a rough PR as a first draft, if you are interested in this feature please let me know and I'll polish it up.