Bug 17579

Summary: Add the Koha::Patron->is_expired method
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: josef.moravec, kyle
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17594    
Bug Blocks: 17522, 17578, 17583    
Attachments: Bug 17579: Add the Koha::Patron->is_expired
[SIGNED-OFF] Bug 17579: Add the Koha::Patron->is_expired
Bug 17579: Add the Koha::Patron->is_expired
Bug 17579: Make sure we are testing the real life
Bug 17579: Add the Koha::Patron->is_expired
Bug 17579: Make sure we are testing the real life
[SIGNED-OFF] Bug 17579: Add the Koha::Patron->is_expired
[SIGNED-OFF] Bug 17579: Make sure we are testing the real life
Bug 17579: Add the Koha::Patron->is_expired
Bug 17579: Make sure we are testing the real life
Bug 17579 [QA Followup] - Fix the number of tests

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!