Description
Jonathan Druart
2016-11-04 16:50:59 UTC
Created attachment 57218 [details] [review] Bug 17557: Revised patron age calculation tests The SetAge and GetAge test coverage are excessive. First the SetAge subroutine was only created for testing purpose. The goal of GetAge is quite simple and it seems quite easy to provide corect test coverage using DateTime->add using negative numbers. Created attachment 57219 [details] [review] Bug 17557: Koha::Patrons - Move GetAge to ->set_age (and remove SetAge) As said in the previous commit, I considered SetAge as unnecessary and removed it. Test plan: 1/ Edit a patron using the different 'Edit' links 2/ Play with the patron category limited to age ranges, and date of birth 3/ You should get the expected warning if the date of birth is inside the patron category date range. To finish: prove t/Circulation/AgeRestrictionMarkers.t t/db_dependent/Reserves.t \ t/db_dependent/Koha/Patrons.t t/db_dependent/Members.t should return green Created attachment 57220 [details] [review] [SIGNED-OFF] Bug 17557: Revised patron age calculation tests The SetAge and GetAge test coverage are excessive. First the SetAge subroutine was only created for testing purpose. The goal of GetAge is quite simple and it seems quite easy to provide corect test coverage using DateTime->add using negative numbers. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Created attachment 57221 [details] [review] [SIGNED-OFF] Bug 17557: Koha::Patrons - Move GetAge to ->set_age (and remove SetAge) As said in the previous commit, I considered SetAge as unnecessary and removed it. Test plan: 1/ Edit a patron using the different 'Edit' links 2/ Play with the patron category limited to age ranges, and date of birth 3/ You should get the expected warning if the date of birth is inside the patron category date range. To finish: prove t/Circulation/AgeRestrictionMarkers.t t/db_dependent/Reserves.t \ t/db_dependent/Koha/Patrons.t t/db_dependent/Members.t should return green Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Created attachment 57862 [details] [review] Bug 17557: Revised patron age calculation tests The SetAge and GetAge test coverage are excessive. First the SetAge subroutine was only created for testing purpose. The goal of GetAge is quite simple and it seems quite easy to provide corect test coverage using DateTime->add using negative numbers. Edit: rebased so it applies Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 57863 [details] [review] Bug 17557: Koha::Patrons - Move GetAge to ->set_age (and remove SetAge) As said in the previous commit, I considered SetAge as unnecessary and removed it. Test plan: 1/ Edit a patron using the different 'Edit' links 2/ Play with the patron category limited to age ranges, and date of birth 3/ You should get the expected warning if the date of birth is inside the patron category date range. To finish: prove t/Circulation/AgeRestrictionMarkers.t t/db_dependent/Reserves.t \ t/db_dependent/Koha/Patrons.t t/db_dependent/Members.t should return green Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Passing rebased patches. Created attachment 58104 [details] [review] Bug 17557: Revised patron age calculation tests The SetAge and GetAge test coverage are excessive. First the SetAge subroutine was only created for testing purpose. The goal of GetAge is quite simple and it seems quite easy to provide corect test coverage using DateTime->add using negative numbers. Edit: rebased so it applies Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 58105 [details] [review] Bug 17557: Koha::Patrons - Move GetAge to ->set_age (and remove SetAge) As said in the previous commit, I considered SetAge as unnecessary and removed it. Test plan: 1/ Edit a patron using the different 'Edit' links 2/ Play with the patron category limited to age ranges, and date of birth 3/ You should get the expected warning if the date of birth is inside the patron category date range. To finish: prove t/Circulation/AgeRestrictionMarkers.t t/db_dependent/Reserves.t \ t/db_dependent/Koha/Patrons.t t/db_dependent/Members.t should return green Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Pushed to master for 17.05, thanks Jonathan! Should this go into 16.11? Hm, missed the second patch looking at git - this is a true enhancement and not just new unit tests. So: This won't get backported to 16.11.x as it is an enhancement. |