From bd2d16982c690e5d9dd46e5812af370d28f1efaf Mon Sep 17 00:00:00 2001 From: Christopher Brannon Date: Thu, 13 Dec 2018 00:08:54 +0000 Subject: [PATCH] Bug 21944: Test for Circulation.pm --- t/db_dependent/Circulation.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 02b45c366a..8c703e54d8 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -40,6 +40,7 @@ use Koha::Patrons; use Koha::Subscriptions; use Koha::Account::Lines; use Koha::Account::Offsets; +use Koha::Items; my $schema = Koha::Database->schema; $schema->storage->txn_begin; @@ -2379,7 +2380,7 @@ subtest '_FixOverduesOnReturn' => sub { }; subtest 'Set waiting flag' => sub { - plan tests => 4; + plan tests => 6; my $library_1 = $builder->build( { source => 'Branch' } ); my $patron_1 = $builder->build( { source => 'Borrower', value => { branchcode => $library_1->{branchcode}, categorycode => $patron_category->{categorycode} } } ); @@ -2427,6 +2428,17 @@ subtest 'Set waiting flag' => sub { is( $hold->found, 'W', 'Hold is waiting' ); ( $status ) = CheckReserves($item->{itemnumber}); is( $status, 'Waiting', 'Now the hold is waiting'); + + #Bug 21944 - Waiting transfer checked in at branch other than pickup location + set_userenv( $library_1 ); + $do_transfer = 1; + AddReturn ( $item->{barcode}, $library_1->{branchcode} ); + ModReserveAffect( $item->{itemnumber}, undef, $do_transfer, $reserve_id ); + $hold = Koha::Holds->find( $reserve_id ); + is( $hold->found, 'T', 'Hold is changed from Waiting to Transfer' ); + ( $status ) = CheckReserves($item->{itemnumber}); + is( $status, 'Reserved', 'Item is now set to a priority level'); + }; subtest 'CanBookBeIssued | is_overdue' => sub { -- 2.11.0