From c46bc31f5af2e3a41d62e689c3c647c0b19242f7 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 30 Dec 2019 19:27:26 +0000 Subject: [PATCH] Bug 19014: Unit tests Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Martin Renvoize --- t/db_dependent/Circulation.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index e87abff2f4..825dbd7b12 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -274,7 +274,7 @@ Koha::CirculationRules->set_rules( my ( $reused_itemnumber_1, $reused_itemnumber_2 ); subtest "CanBookBeRenewed tests" => sub { - plan tests => 71; + plan tests => 75; C4::Context->set_preference('ItemsDeniedRenewal',''); # Generate test biblio @@ -627,6 +627,19 @@ subtest "CanBookBeRenewed tests" => sub { is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic and premature' ); is( $error, 'auto_too_soon', 'Bug 14101: Cannot renew, renewal is automatic and premature, "No renewal before" = undef (returned code is auto_too_soon)' ); + AddReserve( + $branch, $reserving_borrowernumber, $biblio->biblionumber, + $bibitems, $priority, $resdate, $expdate, $notes, + 'a title', $item_4->itemnumber, $found + ); + ( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); + is( $renewokay, 0, 'Still should not be able to renew' ); + is( $error, 'auto_too_soon', 'returned code is auto_too_soon, reserve not checked' ); + ( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); + is( $renewokay, 0, 'Still should not be able to renew' ); + is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); + + # Bug 7413 # Test premature manual renewal -- 2.20.1