Page MenuHomekolab.org

Improve cost calculation on entitlement delete and test
ClosedPublic

Authored by machniak on Sep 22 2020, 4:06 PM.

Details

Reviewers
vanmeeuwen
Group Reviewers
Restricted Project
Commits
rKd7f6cebed76f: Improve cost calculation on entitlement delete and test
Summary

While adding test for T375530 I found that cost calculation
could be improved. Especially existence of unsused variable $dayOfThisMonth suggested that.

So, I changed the code to calculate price per day using current month
if diff in days does not overlap with the previous month.

I still think it should be simplified to use number 30 instead of the number of days in a month.

Test Plan

./phpunit

Diff Detail

Repository
rK kolab
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

machniak requested review of this revision.Sep 22 2020, 4:06 PM
machniak created this revision.
vanmeeuwen accepted this revision.Sep 23 2020, 11:34 AM
This revision is now accepted and ready to land.Sep 23 2020, 11:34 AM
This revision was automatically updated to reflect the committed changes.