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

(-)a/t/db_dependent/SIP/Message.t (-2 / +23 lines)
Lines 108-114 subtest 'Test renew desensitize' => sub { Link Here
108
subtest 'Checkin V2' => sub {
108
subtest 'Checkin V2' => sub {
109
    my $schema = Koha::Database->new->schema;
109
    my $schema = Koha::Database->new->schema;
110
    $schema->storage->txn_begin;
110
    $schema->storage->txn_begin;
111
    plan tests => 40;
111
    plan tests => 46;
112
    $C4::SIP::Sip::protocol_version = 2;
112
    $C4::SIP::Sip::protocol_version = 2;
113
    test_checkin_v2();
113
    test_checkin_v2();
114
    $schema->storage->txn_rollback;
114
    $schema->storage->txn_rollback;
Lines 1264-1269 sub test_checkin_v2 { Link Here
1264
    $item_object->holdingbranch( $branchcode )->store();
1264
    $item_object->holdingbranch( $branchcode )->store();
1265
    t::lib::Mocks::mock_preference( ' AllowReturnToBranch ', 'anywhere' );
1265
    t::lib::Mocks::mock_preference( ' AllowReturnToBranch ', 'anywhere' );
1266
1266
1267
    # Change homebranch to trigger NeedsTransfer response (with and without automatic item return)
1268
    t::lib::Mocks::mock_preference( 'AutomaticItemReturn', 0 );
1269
    $item_object->homebranch($branchcode2)->store();
1270
    undef $response;
1271
    $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
1272
    $msg->handle_checkin($server);
1273
    check_field( $respcode, $response, FID_ALERT_TYPE, '04', 'Got CV 04' );
1274
    check_field(
1275
        $respcode, $response, FID_SCREEN_MSG, 'This item must still be transferred', 'Check screen msg',
1276
        'regex'
1277
    );
1278
    is( $item_object->transfer, undef, 'No transfer was started' );
1279
    t::lib::Mocks::mock_preference( 'AutomaticItemReturn', 1 );
1280
    undef $response;
1281
    $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
1282
    $msg->handle_checkin($server);
1283
    check_field( $respcode, $response, FID_ALERT_TYPE, '04',  'Got CV 04' );
1284
    check_field( $respcode, $response, FID_SCREEN_MSG, undef, 'No screen msg' );
1285
    isnt( $item_object->transfer, undef, 'A transfer was started' );
1286
    $item_object->transfer->delete;
1287
    $item_object->homebranch($branchcode)->store();
1288
1267
    $server->{account}->{cv_send_00_on_success} = 0;
1289
    $server->{account}->{cv_send_00_on_success} = 0;
1268
    undef $response;
1290
    undef $response;
1269
    $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
1291
    $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
1270
- 

Return to bug 36431