From fc46f27a580c1edcba5cf478120d4a2c8ed194d8 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 17 Aug 2015 12:52:55 -0400 Subject: [PATCH] Bug 14337 [QA Followup] - Add unit test --- t/db_dependent/Circulation.t | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 30a5fe7..1381206 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -27,7 +27,7 @@ use C4::Overdues qw(UpdateFine); use Koha::DateUtils; use Koha::Database; -use Test::More tests => 61; +use Test::More tests => 62; BEGIN { use_ok('C4::Circulation'); @@ -301,6 +301,11 @@ C4::Context->dbh->do("DELETE FROM accountlines"); ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber2); is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds'); + C4::Context->dbh->do("UPDATE items SET notforloan = 1 WHERE itemnumber = $itemnumber3"); + ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber); + is( $renewokay, 0, 'Bug 14337 - AllowRenewalIfOtherItemsAvailable counts holdable not for loan items when checking renewability'); + C4::Context->dbh->do("UPDATE items SET notforloan = 0 WHERE itemnumber = $itemnumber3"); + # Now let's add an item level hold, we should no longer be able to renew the item my $hold = Koha::Database->new()->schema()->resultset('Reserve')->create( { -- 1.7.2.5