|
Lines 898-907
subtest do_checkout_with_patron_blocked => sub {
Link Here
|
| 898 |
}; |
898 |
}; |
| 899 |
|
899 |
|
| 900 |
subtest do_checkout_with_noblock => sub { |
900 |
subtest do_checkout_with_noblock => sub { |
| 901 |
plan tests => 3; |
901 |
plan tests => 1; |
|
|
902 |
|
| 903 |
my $mockILS = Test::MockObject->new; |
| 904 |
my $server = { ils => $mockILS }; |
| 902 |
|
905 |
|
| 903 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
906 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 904 |
my $patron = $builder->build_object( |
907 |
|
|
|
908 |
my $institution = { |
| 909 |
id => $library->id, |
| 910 |
implementation => "ILS", |
| 911 |
policy => { |
| 912 |
checkin => "true", |
| 913 |
renewal => "true", |
| 914 |
checkout => "true", |
| 915 |
timeout => 100, |
| 916 |
retries => 5, |
| 917 |
} |
| 918 |
}; |
| 919 |
my $ils = C4::SIP::ILS->new($institution); |
| 920 |
|
| 921 |
my $patron = $builder->build_object( |
| 905 |
{ |
922 |
{ |
| 906 |
class => 'Koha::Patrons', |
923 |
class => 'Koha::Patrons', |
| 907 |
value => { |
924 |
value => { |
|
Lines 911-917
subtest do_checkout_with_noblock => sub {
Link Here
|
| 911 |
} |
928 |
} |
| 912 |
); |
929 |
); |
| 913 |
|
930 |
|
| 914 |
t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode, flags => 1 } ); |
931 |
t::lib::Mocks::mock_userenv( |
|
|
932 |
{ branchcode => $library->branchcode, flags => 1 } ); |
| 915 |
|
933 |
|
| 916 |
my $item = $builder->build_sample_item( |
934 |
my $item = $builder->build_sample_item( |
| 917 |
{ |
935 |
{ |
|
Lines 919-939
subtest do_checkout_with_noblock => sub {
Link Here
|
| 919 |
} |
937 |
} |
| 920 |
); |
938 |
); |
| 921 |
|
939 |
|
| 922 |
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); |
940 |
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); |
| 923 |
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
941 |
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
| 924 |
my $co_transaction = C4::SIP::ILS::Transaction::Checkout->new(); |
|
|
| 925 |
is( |
| 926 |
$co_transaction->patron($sip_patron), |
| 927 |
$sip_patron, "Patron assigned to transaction" |
| 928 |
); |
| 929 |
is( |
| 930 |
$co_transaction->item($sip_item), |
| 931 |
$sip_item, "Item assigned to transaction" |
| 932 |
); |
| 933 |
|
942 |
|
| 934 |
$co_transaction->do_checkout( undef, '19990102 030405' ); |
943 |
my $circ = |
|
|
944 |
$ils->checkout( $patron->cardnumber, $item->barcode, undef, undef, |
| 945 |
$server->{account}, '19990102 030405' ); |
| 935 |
|
946 |
|
| 936 |
is( $patron->checkouts->count, 1, 'No Block checkout was performed for debarred patron' ); |
947 |
is( $patron->checkouts->count, |
|
|
948 |
1, 'No Block checkout was performed for debarred patron' ); |
| 937 |
}; |
949 |
}; |
| 938 |
|
950 |
|
| 939 |
subtest do_checkout_with_holds => sub { |
951 |
subtest do_checkout_with_holds => sub { |
| 940 |
- |
|
|