From d044ad0a26fc0007400a273e4f1e43207ea10cc6 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 10 Sep 2015 16:39:51 +0200 Subject: [PATCH] Bug 14801: Fix Reserves.t Content-Type: text/plain; charset=utf-8 Fix the following errors: not ok 59 - Bug 14464 - No fines at beginning ok 60 - Bug 14464 - 1st reserve correctly created not ok 61 - Bug 14464 - No fines after cancelling reserve with no charge configured ok 62 - Bug 14464 - 2nd reserve correctly created not ok 63 - Bug 14464 - No fines after cancelling reserve with no charge desired Signed-off-by: Marcel de Rooy Signed-off-by: Marc Veron Signed-off-by: Katrin Fischer Signed-off-by: Marcel de Rooy Amended the x==0 test with !x || x==0 to include 0.00 and prevent warn. --- t/db_dependent/Reserves.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 107cee9..bb534c2 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -536,7 +536,7 @@ ok( !C4::Reserves::OnShelfHoldsAllowed($item, $borrower), "OnShelfHoldsAllowed() $dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum)); my ( undef, undef, $bz14464_fines ) = GetMemberIssuesAndFines( $borrowernumber ); -ok( !$bz14464_fines, 'Bug 14464 - No fines at beginning' ); +is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines at beginning' ); # First, test cancelling a reserve when there's no charge configured. t::lib::Mocks::mock_preference('ExpireReservesMaxPickUpDelayCharge', 0); @@ -560,7 +560,7 @@ ok( $bz14464_reserve, 'Bug 14464 - 1st reserve correctly created' ); CancelReserve({ reserve_id => $bz14464_reserve, charge_cancel_fee => 1 }); ( undef, undef, $bz14464_fines ) = GetMemberIssuesAndFines( $borrowernumber ); -ok( !$bz14464_fines, 'Bug 14464 - No fines after cancelling reserve with no charge configured' ); +is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge configured' ); # Then, test cancelling a reserve when there's no charge desired. t::lib::Mocks::mock_preference('ExpireReservesMaxPickUpDelayCharge', 42); @@ -584,7 +584,7 @@ ok( $bz14464_reserve, 'Bug 14464 - 2nd reserve correctly created' ); CancelReserve({ reserve_id => $bz14464_reserve }); ( undef, undef, $bz14464_fines ) = GetMemberIssuesAndFines( $borrowernumber ); -ok( !$bz14464_fines, 'Bug 14464 - No fines after cancelling reserve with no charge desired' ); +is( !$bz14464_fines || $bz14464_fines==0, 1, 'Bug 14464 - No fines after cancelling reserve with no charge desired' ); # Finally, test cancelling a reserve when there's a charge desired and configured. $bz14464_reserve = AddReserve( -- 1.7.10.4