Skip to content
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

tests: port assertEquals() with delta to assertEqualsWithDelta() #5078

Merged
merged 1 commit into from Oct 11, 2022

Conversation

lazka
Copy link
Contributor

@lazka lazka commented Oct 10, 2022

assertEquals() in phpunit 9.5 no longer takes a delta parameter and has assertEqualsWithDelta() as a replacement. This means float get compared without a delta atm, and a recent phpunit release (9.5.25) has made float comparisons stricter resulting in test suite errors such as:

  1. SubtaskTimeTrackingModelTest::testCalculateSubtaskTime Total spent
    Failed asserting that 3.3000000000000003 matches expected 3.3. tests/units/Model/SubtaskTimeTrackingModelTest.php:186

This replaces all assertEquals() calls that pass a delta value with assertEqualsWithDelta().

Do you follow the guidelines?

  • I have tested my changes
  • There is no breaking change
  • There is no regression
  • I follow existing coding style

assertEquals() in phpunit 9.5 no longer takes a delta parameter
and has assertEqualsWithDelta() as a replacement. This means
float get compared without a delta atm, and a recent phpunit
release (9.5.25) has made float comparisons stricter resulting in
test suite errors such as:

1) SubtaskTimeTrackingModelTest::testCalculateSubtaskTime
Total spent
Failed asserting that 3.3000000000000003 matches expected 3.3.
tests/units/Model/SubtaskTimeTrackingModelTest.php:186

This replaces all assertEquals() calls that pass a delta value
with assertEqualsWithDelta().
@lazka
Copy link
Contributor Author

lazka commented Oct 10, 2022

For extra context here is the recent phpunit change triggering those test errors: sebastianbergmann/phpunit#4972

@fguillot fguillot merged commit 0b8a270 into kanboard:main Oct 11, 2022
@lazka
Copy link
Contributor Author

lazka commented Oct 11, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants