[Koha-bugs] [Bug 26307] misc/cronjobs/update_patrons_category.pl --too_old acts a year too early

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Aug 27 16:05:37 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26307

--- Comment #2 from Fridolin SOMERS <fridolin.somers at biblibre.com> ---
Created attachment 109229
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109229&action=edit
Bug 26307: Reveal problem in unit test for too_old

Logic :
=======

Looking at Koha::Patron->get_age :
At birthday aniversary, patron has aged 1 year more.
For example :
 - today is 2020-08-27
 - patron with date of birth 2000-08-28 is 19 year old
 - patron with date of birth 2000-08-27 is 20 year old

Looking at Koha::Patron->is_valid_age :
Category min and max limits are inclusive.
For example max=17 means :
 - patron having 17 years old is valid
 - patron having 18 years old is not valid

Test suite :
===========

Changes child3 to have 18 years tomorrow.
Adds a child4 with 18 years today.

Test plan :
Run prove t/db_dependent/Patrons.t
See it fails on 'One under age patron in child category'

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list