From c3204ae5e501d7a4f7bf562f3f358b1f002aab6b Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 2 Dec 2016 10:30:55 +0100 Subject: [PATCH] Bug 17569: [QA Follow-up] Small changes Content-Type: text/plain; charset=utf-8 Patron.pm: Adds two missing semicolons at the last statement. Not strictly needed, but strongly recommended. Patrons.t: Add a test description, remove two comments that refer to previously hardcoded dates. Signed-off-by: Marcel de Rooy --- Koha/Patron.pm | 4 ++-- t/db_dependent/Koha/Patrons.t | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index a9c3f8a..52df139 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -124,12 +124,12 @@ sub guarantor { sub image { my ( $self ) = @_; - return Koha::Patron::Images->find( $self->borrowernumber ) + return Koha::Patron::Images->find( $self->borrowernumber ); } sub library { my ( $self ) = @_; - return Koha::Library->_new_from_dbic($self->_result->branchcode) + return Koha::Library->_new_from_dbic($self->_result->branchcode); } =head3 guarantees diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t index e81e7af..8cfff2c 100644 --- a/t/db_dependent/Koha/Patrons.t +++ b/t/db_dependent/Koha/Patrons.t @@ -415,7 +415,7 @@ subtest 'search_upcoming_membership_expires' => sub { # Test with branch $upcoming_mem_expires = Koha::Patrons->search_upcoming_membership_expires({ 'me.branchcode' => $library->{branchcode} }); - is( $upcoming_mem_expires->count, 1, ); + is( $upcoming_mem_expires->count, 1, 'Test with branch parameter' ); my $expired = $upcoming_mem_expires->next; is( $expired->surname, $patron_1->{surname}, 'Get upcoming membership expires should return the correct patron.' ); is( $expired->library->branchemail, $library->{branchemail}, 'Get upcoming membership expires should return the correct patron.' ); @@ -433,11 +433,9 @@ subtest 'search_upcoming_membership_expires' => sub { # Test the before parameter t::lib::Mocks::mock_preference( 'MembershipExpiryDaysNotice', 15 ); $upcoming_mem_expires = Koha::Patrons->search_upcoming_membership_expires({ 'me.branchcode' => $library->{branchcode}, before => $nb_of_days_before }); - # Expect 29/6 and 30/6 - is( $upcoming_mem_expires->count, 2, 'Expect two results for before==1'); + is( $upcoming_mem_expires->count, 2, 'Expect two results for before'); # Test after parameter also $upcoming_mem_expires = Koha::Patrons->search_upcoming_membership_expires({ 'me.branchcode' => $library->{branchcode}, before => $nb_of_days_before, after => $nb_of_days_after }); - # Expect 29/6, 30/6 and 2/7 is( $upcoming_mem_expires->count, 3, 'Expect three results when adding after' ); Koha::Patrons->search({ borrowernumber => { in => [ $patron_1->{borrowernumber}, $patron_2->{borrowernumber}, $patron_3->{borrowernumber} ] } })->delete; }; -- 2.1.4