From 77a2f4191fa6f94f7fb6b149c3e98e43d101ba1d Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 8 Dec 2020 14:18:11 +0000 Subject: [PATCH] Bug 27166: Unit tests Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Martin Renvoize Signed-off-by: Andrew Fuerste-Henry (cherry picked from commit 409d1114d9eed91fd3ca9c19fd409965c17d6157) Signed-off-by: Victor Grousset/tuxayo --- t/db_dependent/SIP/Transaction.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t index c6b2ce7abc..5945188eae 100755 --- a/t/db_dependent/SIP/Transaction.t +++ b/t/db_dependent/SIP/Transaction.t @@ -243,9 +243,10 @@ subtest do_hold => sub { }; subtest do_checkin => sub { - plan tests => 8; + plan tests => 11; my $library = $builder->build_object( { class => 'Koha::Libraries' } ); + my $library2 = $builder->build_object( { class => 'Koha::Libraries' } ); my $patron = $builder->build_object( { class => 'Koha::Patrons', @@ -291,6 +292,12 @@ subtest do_checkin => sub { is( $patron->checkouts->count, 1, 'Checkout should have been done successfully'); $ci_transaction->do_checkin($library->branchcode, undef); is( $patron->checkouts->count, 0, 'Checkin should have been done successfully'); + + my $result = $ci_transaction->do_checkin($library2->branchcode, undef); + is($ci_transaction->alert_type,'04',"Checkin of item no issued at another branch succeeds"); + is_deeply($result,{ messages => { 'NotIssued' => $item->barcode, 'WasTransfered' => 1 } },"Messages show not issued and transferred"); + is( $ci_transaction->item->destination_loc,$library->branchcode,"Item destination correctly set"); + }; subtest checkin_lost => sub { -- 2.20.1