Browse Source

Bug 22014: Unit tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
19.05.x
Kyle Hall 4 years ago
committed by Nick Clemens
parent
commit
08c83dbc6e
  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 => 21;
plan tests => 23;
$C4::SIP::Sip::protocol_version = 2;
test_checkin_v2();
$schema->storage->txn_rollback;
@ -362,6 +362,22 @@ sub test_checkin_v2 {
check_field( $respcode, $response, FID_SCREEN_MSG, undef, 'No screen msg' );
$server->{account}->{checked_in_ok} = 0;
$server->{account}->{checked_in_ok} = 1;
$server->{account}->{cv_send_00_on_success} = 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_ALERT_TYPE, undef, 'No FID_ALERT_TYPE (CV) field' );
$server->{account}->{cv_send_00_on_success} = 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_ALERT_TYPE, '00', 'FID_ALERT_TYPE (CV) field is 00' );
$server->{account}->{checked_in_ok} = 0;
$server->{account}->{cv_send_00_on_success} = 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