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
assertSame broken after 9.5.14 version #5045
Comments
This may be fixed by #4972. |
|
@sebastianbergmann #4972 did not fix the problem: |
@bancer the assertion is correctly not met - https://3v4l.org/5CiYa |
Well, everybody could assume that 40.7 is mathematically the same value as 40.8-0.1. |
you can use |
I ran in to this problem today after doing what is supposed to be a safe composer update since we have caret notation and minor and patch updates should never have breaking changes. This very much is a breaking change and not even on a minor but patch version which I find extremely surprising. Was this an unintended and unknown breaking change? Or should the phpunit lib be considered unsafe and potentially breaking to update even patch changes on? That should be very clearly stated in the documentation in that case. |
I think that strictly speaking, the change could be considered a patch only. The previous behaviour (<= 9.5.13) was incorrect, as an assertion could pass even if it clearly shouldn't have. Comparisons between floats should not be done with That being said, since many people relied on this incorrect behaviour, including it in a major release might have been a better approach. |
Summary
Assuming the following test:
In version 9.5.13 this test works perfect:
But, in version 9.5.14, it breaks
Any ideas? I try to set
serialize_precision = 16
, but the problem continued.The text was updated successfully, but these errors were encountered: