Summary: | t/db_dependent/Koha/Patrons.t contains a DateTime math error | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | Test Suite | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart, lucas, nick, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 17699 | ||
Bug Blocks: | |||
Attachments: |
Bug 22254: Correction to datehandling in test
Bug 22254: Correction to datehandling in test Bug 22254: Correction to datehandling in test |
Description
Martin Renvoize (ashimema)
2019-02-01 09:53:09 UTC
Created attachment 84599 [details] [review] Bug 22254: Correction to datehandling in test Adding 13 months is not always the same as adding 1 month and then adding 12 months in DateTime maths. This patch rectified the test to match the correct behaviour in koha. Test plan. 1) Modify the test (around line 268) to test against the suspect leap date of 2019-01-31 and watch the test fail. 2) Apply the patch (which also adds this modification to test for such a leap date) and watch the test now pass. Created attachment 84600 [details] [review] Bug 22254: Correction to datehandling in test Adding 13 months is not always the same as adding 1 month and then adding 12 months in DateTime maths. This patch rectified the test to match the correct behaviour in koha. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 84677 [details] [review] Bug 22254: Correction to datehandling in test Adding 13 months is not always the same as adding 1 month and then adding 12 months in DateTime maths. This patch rectified the test to match the correct behaviour in koha. Test plan. 1) Modify the test (around line 268) to test against the suspect leap date of 2019-01-31 and watch the test fail. 2) Apply the patch (which also adds this modification to test for such a leap date) and watch the test now pass. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Awesome work all! Pushed to master for 19.05 Pushed to 18.11.x for 18.11.03 backported to 18.05.x for 18.05.09 Good catch Martin. I would have added more dates, like: + for my $date ( '2016-03-31', '2016-11-30', '2019-01-31', '2020-02-28', '2020-01-31', '2020-02-29', dt_from_string() ) { Just in case ;) Pushed to 17.11.x for 17.11.16 |