From f018d99c5ff8a88b01dd36009d8f4a0d039f73ce Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 17 Jan 2014 09:05:40 -0500 Subject: [PATCH] Bug 10452 [QA Followup] - Unit tests --- t/db_dependent/Holds.t | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index 2c28c07..c237d16 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -6,7 +6,7 @@ use t::lib::Mocks; use C4::Context; use C4::Branch; -use Test::More tests => 25; +use Test::More tests => 29; use MARC::Record; use C4::Biblio; use C4::Items; @@ -278,6 +278,14 @@ ModReserve({ reserve_id => $reserveid2, rank => 'del' }); $reserve3 = GetReserve( $reserveid3 ); is( $reserve3->{priority}, 1, "After ModReserve, the 3rd reserve becomes the first on the waiting list" ); +ModItem({ damaged => 1 }, $item_bibnum, $itemnumber); +C4::Context->set_preference( 'AllowHoldsOnDamagedItems', 1 ); +ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber), "Patron can reserve damaged item with AllowHoldsOnDamagedItems enabled" ); +ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold can be trapped for damaged item with AllowHoldsOnDamagedItems enabled" ); +C4::Context->set_preference( 'AllowHoldsOnDamagedItems', 0 ); +ok( !CanItemBeReserved( $borrowernumbers[0], $itemnumber), "Patron cannot reserve damaged item with AllowHoldsOnDamagedItems disabled" ); +ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold can be trapped for damaged item with AllowHoldsOnDamagedItems enabled" ); + # Helper method to set up a Biblio. sub create_helper_biblio { -- 1.7.2.5