Bug 22443 - t/db_dependent/Koha/Patron/Categories.t contains a DateTime maths error
Summary: t/db_dependent/Koha/Patron/Categories.t contains a DateTime maths error
Status: RESOLVED DUPLICATE of bug 22446
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-01 16:58 UTC by Martin Renvoize
Modified: 2019-03-05 14:29 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22443: Increase test coverage of get_expiry_date (4.96 KB, patch)
2019-03-04 09:27 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 22443: Increase test coverage of get_expiry_date (5.02 KB, patch)
2019-03-04 10:14 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2019-03-01 16:58:17 UTC
So, one of the peculiarities of DateTime maths is that 12 plus 1 doesn't always equal 13 ;)

This calls for an example (using 'limit' for end_of_month mode):

2019-01-31 + 1 month = 2019-02-28
2019-01-31 + 13 months = 2020-02-29 (this one maintains 'end of month' over the leap year)
2019-02-28 + 12 months = 2020-02-28

Koha does the third case but the test is currently setup for the second.

'dateexpiry'
Comment 1 Martin Renvoize 2019-03-04 09:27:49 UTC
Created attachment 85973 [details] [review]
Bug 22443: Increase test coverage of get_expiry_date

This method did not test for 'special' dates, i.e. handling for leap
years.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 2 Martin Renvoize 2019-03-04 10:14:15 UTC
Created attachment 85974 [details] [review]
Bug 22443: Increase test coverage of get_expiry_date

This method did not test for 'special' dates, i.e. handling for leap
years.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Jonathan Druart 2019-03-04 13:08:33 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2019-03-04 13:09:22 UTC
Did not see the patch on bug 22446? :-/
Comment 5 Jonathan Druart 2019-03-04 17:08:51 UTC
Switched to in discussion, see related bug report.
Comment 6 Martin Renvoize 2019-03-05 14:29:10 UTC
I agree with Jonathan.. think we should close this one as a duplicate.

*** This bug has been marked as a duplicate of bug 22446 ***