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 871-877
subtest do_checkout_with_noblock => sub {
Link Here
|
871 |
} |
888 |
} |
872 |
); |
889 |
); |
873 |
|
890 |
|
874 |
t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode, flags => 1 } ); |
891 |
t::lib::Mocks::mock_userenv( |
|
|
892 |
{ branchcode => $library->branchcode, flags => 1 } ); |
875 |
|
893 |
|
876 |
my $item = $builder->build_sample_item( |
894 |
my $item = $builder->build_sample_item( |
877 |
{ |
895 |
{ |
Lines 879-899
subtest do_checkout_with_noblock => sub {
Link Here
|
879 |
} |
897 |
} |
880 |
); |
898 |
); |
881 |
|
899 |
|
882 |
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); |
900 |
my $sip_patron = C4::SIP::ILS::Patron->new( $patron->cardnumber ); |
883 |
my $sip_item = C4::SIP::ILS::Item->new( $item->barcode ); |
901 |
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 |
|
902 |
|
894 |
$co_transaction->do_checkout( undef, '19990102 030405' ); |
903 |
my $circ = |
|
|
904 |
$ils->checkout( $patron->cardnumber, $item->barcode, undef, undef, |
905 |
$server->{account}, '19990102 030405' ); |
895 |
|
906 |
|
896 |
is( $patron->checkouts->count, 1, 'No Block checkout was performed for debarred patron' ); |
907 |
is( $patron->checkouts->count, |
|
|
908 |
1, 'No Block checkout was performed for debarred patron' ); |
897 |
}; |
909 |
}; |
898 |
|
910 |
|
899 |
subtest do_checkout_with_holds => sub { |
911 |
subtest do_checkout_with_holds => sub { |
900 |
- |
|
|