Browse Source

Bug 22016: Unit tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
19.05.x
Kyle Hall 4 years ago
committed by Nick Clemens
parent
commit
f9162c2e5e
  1. 18
      t/db_dependent/SIP/Message.t

18
t/db_dependent/SIP/Message.t

@ -67,7 +67,7 @@ subtest 'Testing Patron Info Request V2' => sub {
subtest 'Checkin V2' => sub {
my $schema = Koha::Database->new->schema;
$schema->storage->txn_begin;
plan tests => 23;
plan tests => 25;
$C4::SIP::Sip::protocol_version = 2;
test_checkin_v2();
$schema->storage->txn_rollback;
@ -378,6 +378,22 @@ sub test_checkin_v2 {
$server->{account}->{checked_in_ok} = 0;
$server->{account}->{cv_send_00_on_success} = 0;
$server->{account}->{checked_in_ok} = 1;
$server->{account}->{ct_always_send} = 0;
undef $response;
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
$msg->handle_checkin( $server );
$respcode = substr( $response, 0, 2 );
check_field( $respcode, $response, FID_DESTINATION_LOCATION, undef, 'No FID_DESTINATION_LOCATION (CT) field' );
$server->{account}->{ct_always_send} = 1;
undef $response;
$msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
$msg->handle_checkin( $server );
$respcode = substr( $response, 0, 2 );
check_field( $respcode, $response, FID_DESTINATION_LOCATION, q{}, 'FID_DESTINATION_LOCATION (CT) field is empty but present' );
$server->{account}->{checked_in_ok} = 0;
$server->{account}->{ct_always_send} = 0;
# Checkin at wrong branch: issue item and switch branch, and checkin
my $issue = Koha::Checkout->new({ branchcode => $branchcode, borrowernumber => $patron1->{borrowernumber}, itemnumber => $item->{itemnumber} })->store;
$branchcode = $builder->build({ source => 'Branch' })->{branchcode};

Loading…
Cancel
Save