Lines 4-10
Link Here
|
4 |
# This needs to be extended! Your help is appreciated.. |
4 |
# This needs to be extended! Your help is appreciated.. |
5 |
|
5 |
|
6 |
use Modern::Perl; |
6 |
use Modern::Perl; |
7 |
use Test::More tests => 6; |
7 |
use Test::More tests => 7; |
8 |
|
8 |
|
9 |
use Koha::Database; |
9 |
use Koha::Database; |
10 |
use Koha::Patrons; |
10 |
use Koha::Patrons; |
Lines 30-35
$schema->resultset('Borrower')->search({ cardnumber => $card })->delete;
Link Here
|
30 |
my $sip_patron2 = C4::SIP::ILS::Patron->new( $card ); |
30 |
my $sip_patron2 = C4::SIP::ILS::Patron->new( $card ); |
31 |
is( $sip_patron2, undef, "Patron is not valid (anymore)" ); |
31 |
is( $sip_patron2, undef, "Patron is not valid (anymore)" ); |
32 |
|
32 |
|
|
|
33 |
subtest "new tests" => sub { |
34 |
|
35 |
plan tests => 5; |
36 |
|
37 |
my $patron = $builder->build( |
38 |
{ |
39 |
source => 'Borrower' |
40 |
} |
41 |
); |
42 |
|
43 |
my $cardnumber = $patron->{cardnumber}; |
44 |
my $userid = $patron->{userid}; |
45 |
my $borrowernumber = $patron->{borrowernumber}; |
46 |
|
47 |
my $ils_patron = C4::SIP::ILS::Patron->new($cardnumber); |
48 |
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via cardnumber scalar' ); |
49 |
$ils_patron = C4::SIP::ILS::Patron->new($userid); |
50 |
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via userid scalar' ); |
51 |
$ils_patron = C4::SIP::ILS::Patron->new( { borrowernumber => $borrowernumber } ); |
52 |
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via borrowernumber hashref' ); |
53 |
$ils_patron = C4::SIP::ILS::Patron->new( { cardnumber => $cardnumber } ); |
54 |
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via cardnumber hashref' ); |
55 |
$ils_patron = C4::SIP::ILS::Patron->new( { userid => $userid } ); |
56 |
is( ref($ils_patron), 'C4::SIP::ILS::Patron', 'Found patron via userid hashref' ); |
57 |
}; |
58 |
|
33 |
subtest "OverduesBlockCirc tests" => sub { |
59 |
subtest "OverduesBlockCirc tests" => sub { |
34 |
|
60 |
|
35 |
plan tests => 6; |
61 |
plan tests => 6; |
36 |
- |
|
|