[Bug 17557] New: Move GetAge to Koha::Patron->get_age (and remove SetAge)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Bug ID: 17557 Summary: Move GetAge to Koha::Patron->get_age (and remove SetAge) Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |16846 Depends on| |17521 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16846 [Bug 16846] Move patron related code to Koha::Patron https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17521 [Bug 17521] Step 3 of patron modification editor not checking age limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 57218 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57218&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 57219 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57219&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57218|0 |1 is obsolete| | Attachment #57219|0 |1 is obsolete| | --- Comment #3 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 57220 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57220&action=edit [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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 --- Comment #4 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 57221 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57221&action=edit [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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57220|0 |1 is obsolete| | --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 57862 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57862&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57221|0 |1 is obsolete| | --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 57863 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57863&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |tomascohen@gmail.com --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Passing rebased patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #57862|0 |1 is obsolete| | Attachment #57863|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 58104 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58104&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 58105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58105&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Should this go into 16.11? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17557 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 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. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org