Bug 21944: Test for Circulation.pm

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Christopher Brannon 2018-12-13 00:08:54 +00:00 committed by Martin Renvoize
parent fe43d98bd1
commit ccf4dfc3e9
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -2909,7 +2909,7 @@ subtest '_FixAccountForLostAndFound returns undef if patron is deleted' => sub {
};
subtest 'Set waiting flag' => sub {
plan tests => 4;
plan tests => 9;
my $library_1 = $builder->build( { source => 'Branch' } );
my $patron_1 = $builder->build( { source => 'Borrower', value => { branchcode => $library_1->{branchcode}, categorycode => $patron_category->{categorycode} } } );
@ -2951,6 +2951,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 );
(undef, my $messages, undef, undef ) = AddReturn ( $item->{barcode}, $library_1->{branchcode} );
$hold = Koha::Holds->find( $reserve_id );
is( $hold->found, undef, 'Hold is no longer marked waiting' );
is( $hold->priority, 1, "Hold is now priority one again");
is( $messages->{ResFound}->{ResFound}, "Reserved", "Hold is still returned");
is( $messages->{ResFound}->{found}, undef, "Hold is no longer marked found in return message");
is( $messages->{ResFound}->{priority}, 1, "Hold is priority 1 in return message");
};
subtest 'Cancel transfers on lost items' => sub {