View | Details | Raw Unified | Return to bug 17568
Collapse All | Expand All

(-)a/Koha/Patron.pm (+5 lines)
Lines 113-118 sub image { Link Here
113
    return Koha::Patron::Images->find( $self->borrowernumber )
113
    return Koha::Patron::Images->find( $self->borrowernumber )
114
}
114
}
115
115
116
sub library {
117
    my ( $self ) = @_;
118
    return Koha::Library->_new_from_dbic($self->_result->branchcode)
119
}
120
116
=head3 guarantees
121
=head3 guarantees
117
122
118
Returns the guarantees (list of Koha::Patron) of this patron
123
Returns the guarantees (list of Koha::Patron) of this patron
(-)a/t/db_dependent/Koha/Patrons.t (-2 / +7 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 11;
22
use Test::More tests => 12;
23
use Test::Warn;
23
use Test::Warn;
24
24
25
use C4::Members;
25
use C4::Members;
Lines 68-73 is( Koha::Patrons->search->count, $nb_of_patrons + 2, 'The 2 patrons should have Link Here
68
my $retrieved_patron_1 = Koha::Patrons->find( $new_patron_1->borrowernumber );
68
my $retrieved_patron_1 = Koha::Patrons->find( $new_patron_1->borrowernumber );
69
is( $retrieved_patron_1->cardnumber, $new_patron_1->cardnumber, 'Find a patron by borrowernumber should return the correct patron' );
69
is( $retrieved_patron_1->cardnumber, $new_patron_1->cardnumber, 'Find a patron by borrowernumber should return the correct patron' );
70
70
71
subtest 'library' => sub {
72
    plan tests => 2;
73
    is( $retrieved_patron_1->library->branchcode, $library->{branchcode}, 'Koha::Patron->library should return the correct library' );
74
    is( ref($retrieved_patron_1->library), 'Koha::Library', 'Koha::Patron->library should return a Koha::Library object' );
75
};
76
71
subtest 'guarantees' => sub {
77
subtest 'guarantees' => sub {
72
    plan tests => 8;
78
    plan tests => 8;
73
    my $guarantees = $new_patron_1->guarantees;
79
    my $guarantees = $new_patron_1->guarantees;
74
- 

Return to bug 17568