Bug 17569: [QA Follow-up] Small changes
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 <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
4c00190250
commit
f43a73597e
2 changed files with 4 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -569,7 +569,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.' );
|
||||
|
@ -587,11 +587,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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue