From 3ef636120c2826cdcdffb901fb902e2ae5aa2e33 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 30 Mar 2015 10:16:11 -0400 Subject: [PATCH] [PASSED QA] Bug 13919 - Unit Test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested both unit test patches together. Without main patch applied: do not pass as expected / with main patch pass OK as expected. Signed-off-by: Marc VĂ©ron Signed-off-by: Katrin Fischer --- t/db_dependent/Circulation.t | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index e48ab70..53ea1ce 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -300,9 +300,24 @@ C4::Context->dbh->do("DELETE FROM accountlines"); is( $renewokay, 1, 'Bug 11634 - Allow renewal of item with unfilled holds if other available items can fill those holds'); ( $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'); + + # 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( + { + borrowernumber => $hold_waiting_borrowernumber, + biblionumber => $biblionumber, + itemnumber => $itemnumber, + branchcode => $branch, + priority => 3, + } + ); + ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $itemnumber); + is( $renewokay, 0, 'Bug 13919 - Renewal possible with item level hold on item'); + $hold->delete(); + # Now let's add a waiting hold on the 3rd item, it's no longer available tp check out by just anyone, so we should no longer # be able to renew these items - my $hold = Koha::Database->new()->schema()->resultset('Reserve')->create( + $hold = Koha::Database->new()->schema()->resultset('Reserve')->create( { borrowernumber => $hold_waiting_borrowernumber, biblionumber => $biblionumber, -- 1.9.1