|
Lines 858-867
subtest do_checkout_with_patron_blocked => sub {
Link Here
|
| 858 |
}; |
858 |
}; |
| 859 |
|
859 |
|
| 860 |
subtest do_checkout_with_noblock => sub { |
860 |
subtest do_checkout_with_noblock => sub { |
| 861 |
plan tests => 3; |
861 |
plan tests => 1; |
|
|
862 |
|
| 863 |
my $mockILS = Test::MockObject->new; |
| 864 |
my $server = { ils => $mockILS }; |
| 862 |
|
865 |
|
| 863 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
866 |
my $library = $builder->build_object( { class => 'Koha::Libraries' } ); |
| 864 |
my $patron = $builder->build_object( |
867 |
|
|
|
868 |
my $institution = { |
| 869 |
id => $library->id, |
| 870 |
implementation => "ILS", |
| 871 |
policy => { |
| 872 |
checkin => "true", |
| 873 |
renewal => "true", |
| 874 |
checkout => "true", |
| 875 |
timeout => 100, |
| 876 |
retries => 5, |
| 877 |
} |
| 878 |
}; |
| 879 |
my $ils = C4::SIP::ILS->new($institution); |
| 880 |
|
| 881 |
my $patron = $builder->build_object( |
| 865 |
{ |
882 |
{ |
| 866 |
class => 'Koha::Patrons', |
883 |
class => 'Koha::Patrons', |
| 867 |
value => { |
884 |
value => { |
|
Lines 879-899
subtest do_checkout_with_noblock => sub {
Link Here
|
| 879 |
} |
896 |
} |
| 880 |
); |
897 |
); |
| 881 |
|
898 |
|
| 882 |
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); |
899 |
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); |
| 883 |
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
900 |
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
| 884 |
my $co_transaction = C4::SIP::ILS::Transaction::Checkout->new(); |
|
|
| 885 |
is( |
| 886 |
$co_transaction->patron($sip_patron), |
| 887 |
$sip_patron, "Patron assigned to transaction" |
| 888 |
); |
| 889 |
is( |
| 890 |
$co_transaction->item($sip_item), |
| 891 |
$sip_item, "Item assigned to transaction" |
| 892 |
); |
| 893 |
|
901 |
|
| 894 |
$co_transaction->do_checkout( undef, '19990102 030405' ); |
902 |
my $circ = |
|
|
903 |
$ils->checkout( $patron->cardnumber, $item->barcode, undef, undef, |
| 904 |
$server->{account}, '19990102 030405' ); |
| 895 |
|
905 |
|
| 896 |
is( $patron->checkouts->count, 1, 'No Block checkout was performed for debarred patron' ); |
906 |
is( $patron->checkouts->count, |
|
|
907 |
1, 'No Block checkout was performed for debarred patron' ); |
| 897 |
}; |
908 |
}; |
| 898 |
|
909 |
|
| 899 |
subtest do_checkout_with_holds => sub { |
910 |
subtest do_checkout_with_holds => sub { |
|
Lines 917-923
subtest do_checkout_with_holds => sub {
Link Here
|
| 917 |
} |
928 |
} |
| 918 |
); |
929 |
); |
| 919 |
|
930 |
|
| 920 |
t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode, flags => 1 } ); |
931 |
t::lib::Mocks::mock_userenv( |
|
|
932 |
{ branchcode => $library->branchcode, flags => 1 } ); |
| 921 |
|
933 |
|
| 922 |
my $item = $builder->build_sample_item( |
934 |
my $item = $builder->build_sample_item( |
| 923 |
{ |
935 |
{ |
| 924 |
- |
|
|