Bug 22443

Summary: t/db_dependent/Koha/Patron/Categories.t contains a DateTime maths error
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Test SuiteAssignee: Martin Renvoize <martin.renvoize>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22446
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
Bug 22443: Increase test coverage of get_expiry_date

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 ***