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

(-)a/Koha/Patron.pm (+5 lines)
Lines 127-132 sub image { Link Here
127
    return Koha::Patron::Images->find( $self->borrowernumber )
127
    return Koha::Patron::Images->find( $self->borrowernumber )
128
}
128
}
129
129
130
sub library {
131
    my ( $self ) = @_;
132
    return Koha::Library->_new_from_dbic($self->_result->branchcode)
133
}
134
130
=head3 guarantees
135
=head3 guarantees
131
136
132
Returns the guarantees (list of Koha::Patron) of this patron
137
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 => 13;
22
use Test::More tests => 14;
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