-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
assertContainsEquals()
does not work with DateInterval
objects
#5922
Comments
assertContainsEquals()
does not work with DateInterval
objects
I can confirm this with PHPUnit 11.3, but I do not understand how this could have worked with previous versions such as PHPUnit 10.5.
|
We can find answer in PHP documentation: https://www.php.net/manual/en/class.dateinterval.php Since there is no well defined way to compare date intervals, DateInterval instances are incomparable. Simple test:
and result:
I think, we should consider this issue as bug in PHPUnit version 10. |
Summary
assertContainsEquals
does not work with\DateInterval
Current behavior
test_2
failes withErrorException: Warning: Cannot compare DateInterval objects
How to reproduce
Expected behavior
test_2
passes without warningsThe text was updated successfully, but these errors were encountered: