Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Igor Timoshenkov t1gor

💭
I may be slow to respond.
Block or report user

Report or block t1gor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@drock
drock / DateTimeComparator.php
Last active Jun 26, 2018
A comparator object for PHPUnit to support asserting that two DateTime objects are logically equaly.
View DateTimeComparator.php
<?php
/**
* Class DateTimeComparator
*
* Custom Comparator for PHPUnit to compare two DateTime objects
* The default object comparator will report some DateTime object pairs
* as not equal even if they are canonically equal because the object
* comparator looks a exact object field values. A DateTime object
* can have multiple timezone values that represent the same timezone
* however. This comparator compares the object's UTC timestamps
You can’t perform that action at this time.