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

(-)a/t/db_dependent/SIP/Message.t (-2 / +19 lines)
Lines 71-77 subtest 'Testing Patron Info Request V2' => sub { Link Here
71
subtest 'Checkout V2' => sub {
71
subtest 'Checkout V2' => sub {
72
    my $schema = Koha::Database->new->schema;
72
    my $schema = Koha::Database->new->schema;
73
    $schema->storage->txn_begin;
73
    $schema->storage->txn_begin;
74
    plan tests => 5;
74
    plan tests => 8;
75
    $C4::SIP::Sip::protocol_version = 2;
75
    $C4::SIP::Sip::protocol_version = 2;
76
    test_checkout_v2();
76
    test_checkout_v2();
77
    $schema->storage->txn_rollback;
77
    $schema->storage->txn_rollback;
Lines 824-829 sub test_checkout_v2 { Link Here
824
    $msg->handle_checkout( $server );
824
    $msg->handle_checkout( $server );
825
    ok( $response =~ m/AH\d{4}-\d{2}-\d{2}/, "Found AH field as SQL date in response");
825
    ok( $response =~ m/AH\d{4}-\d{2}-\d{2}/, "Found AH field as SQL date in response");
826
826
827
    #returning item and now testing for blocked_item_types
828
    t::lib::Mocks::mock_preference( 'CheckPrevCheckout',  'hardno' );
829
    AddReturn($item_object->barcode, $branchcode);
830
831
    $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
832
    $server->{account}->{blocked_item_types} = "CR|".$item_object->itype;
833
    $msg->handle_checkout( $server );
834
    $respcode = substr( $response, 0, 2 );
835
    check_field( $respcode, $response, FID_SCREEN_MSG, 'Item type cannot be checked out at this checkout location', 'Check screen msg', 'equals' );
836
837
    is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 0, "Item was not checked out (item type matched blocked_item_types)");
838
839
    $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
840
    $server->{account}->{blocked_item_types} = "";
841
    $msg->handle_checkout( $server );
842
    $respcode = substr( $response, 0, 2 );
843
    is( Koha::Checkouts->search({ itemnumber => $item_object->id })->count, 1, "Item was checked out successfully");
844
827
}
845
}
828
846
829
sub test_checkin_v2 {
847
sub test_checkin_v2 {
830
- 

Return to bug 34101