Bug 17579 - Add the Koha::Patron->is_expired method
Summary: Add the Koha::Patron->is_expired method
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 17594
Blocks: 17522 17578 17583
  Show dependency treegraph
 
Reported: 2016-11-08 10:08 UTC by Jonathan Druart
Modified: 2017-06-14 22:15 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 17579: Add the Koha::Patron->is_expired (2.70 KB, patch)
2016-11-08 10:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17579: Add the Koha::Patron->is_expired (2.77 KB, patch)
2016-11-08 12:47 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17579: Add the Koha::Patron->is_expired (2.75 KB, patch)
2016-11-08 15:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17579: Make sure we are testing the real life (2.84 KB, patch)
2016-11-09 13:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17579: Add the Koha::Patron->is_expired (2.76 KB, patch)
2016-11-10 08:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17579: Make sure we are testing the real life (2.84 KB, patch)
2016-11-10 08:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17579: Add the Koha::Patron->is_expired (2.82 KB, patch)
2016-11-15 09:57 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17579: Make sure we are testing the real life (2.91 KB, patch)
2016-11-15 09:57 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17579: Add the Koha::Patron->is_expired (2.72 KB, patch)
2016-11-15 15:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17579: Make sure we are testing the real life (2.95 KB, patch)
2016-11-15 15:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 17579 [QA Followup] - Fix the number of tests (690 bytes, patch)
2016-11-15 15:27 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-11-08 10:08:30 UTC

    
Comment 1 Jonathan Druart 2016-11-08 10:35:46 UTC
Created attachment 57297 [details] [review]
Bug 17579: Add the Koha::Patron->is_expired

This new method will be handy for further uses

Test plan:
  prove t/db_dependent/Koha/Patrons.t
should return green
Comment 2 Josef Moravec 2016-11-08 12:47:24 UTC
Created attachment 57320 [details] [review]
[SIGNED-OFF] Bug 17579: Add the Koha::Patron->is_expired

This new method will be handy for further uses

Test plan:
  prove t/db_dependent/Koha/Patrons.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 3 Jonathan Druart 2016-11-08 15:41:02 UTC
Created attachment 57332 [details] [review]
Bug 17579: Add the Koha::Patron->is_expired

This new method will be handy for further uses

Test plan:
  prove t/db_dependent/Koha/Patrons.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 4 Jonathan Druart 2016-11-09 13:27:56 UTC
Created attachment 57386 [details] [review]
Bug 17579: Make sure we are testing the real life

Without this patch, the tests are not testing the same things as what
happens on the interface.
We need to refresh the object to make sure the date set into dateexpiry
is the one in DB.
Without this patch, ->is_expired test a datetime object, with this patch
it compares with a date oject

Without the changes made in Koha::Patron->is_expired, a patron which has
a dateexpiry set to today was marked as expired on the interface. This
is a change in the behavior, what this refactoring does not want to do.
Comment 5 Jonathan Druart 2016-11-10 08:37:18 UTC
Created attachment 57411 [details] [review]
Bug 17579: Add the Koha::Patron->is_expired

This new method will be handy for further uses

Test plan:
  prove t/db_dependent/Koha/Patrons.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Jonathan Druart 2016-11-10 08:37:22 UTC
Created attachment 57412 [details] [review]
Bug 17579: Make sure we are testing the real life

Without this patch, the tests are not testing the same things as what
happens on the interface.
We need to refresh the object to make sure the date set into dateexpiry
is the one in DB.
Without this patch, ->is_expired test a datetime object, with this patch
it compares with a date oject

Without the changes made in Koha::Patron->is_expired, a patron which has
a dateexpiry set to today was marked as expired on the interface. This
is a change in the behavior, what this refactoring does not want to do.
Comment 7 Jonathan Druart 2016-11-10 08:38:04 UTC
I have removed the dependency on bug 17580 to make these patches reusable by other patches.
Comment 8 Josef Moravec 2016-11-15 09:57:28 UTC
Created attachment 57475 [details] [review]
[SIGNED-OFF] Bug 17579: Add the Koha::Patron->is_expired

This new method will be handy for further uses

Test plan:
  prove t/db_dependent/Koha/Patrons.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 9 Josef Moravec 2016-11-15 09:57:35 UTC
Created attachment 57476 [details] [review]
[SIGNED-OFF] Bug 17579: Make sure we are testing the real life

Without this patch, the tests are not testing the same things as what
happens on the interface.
We need to refresh the object to make sure the date set into dateexpiry
is the one in DB.
Without this patch, ->is_expired test a datetime object, with this patch
it compares with a date oject

Without the changes made in Koha::Patron->is_expired, a patron which has
a dateexpiry set to today was marked as expired on the interface. This
is a change in the behavior, what this refactoring does not want to do.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 10 Kyle M Hall 2016-11-15 15:27:42 UTC
Created attachment 57498 [details] [review]
Bug 17579: Add the Koha::Patron->is_expired

This new method will be handy for further uses

Test plan:
  prove t/db_dependent/Koha/Patrons.t
should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Kyle M Hall 2016-11-15 15:27:50 UTC
Created attachment 57499 [details] [review]
Bug 17579: Make sure we are testing the real life

Without this patch, the tests are not testing the same things as what
happens on the interface.
We need to refresh the object to make sure the date set into dateexpiry
is the one in DB.
Without this patch, ->is_expired test a datetime object, with this patch
it compares with a date oject

Without the changes made in Koha::Patron->is_expired, a patron which has
a dateexpiry set to today was marked as expired on the interface. This
is a change in the behavior, what this refactoring does not want to do.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 12 Kyle M Hall 2016-11-15 15:27:53 UTC
Created attachment 57500 [details] [review]
Bug 17579 [QA Followup] - Fix the number of tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 13 Kyle M Hall 2016-11-15 15:37:39 UTC
Pushed to master for 16.11, thanks Jonathan!