From 7aa79b87132e45e1d8a7bbd8928560b663bb8d17 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 17 Jul 2014 12:17:48 -0400 Subject: [PATCH] Bug 12596 - Unit Test Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi Signed-off-by: Galen Charlton (cherry picked from commit 90328d0811c8c253188a4cb6192d9a6915fcd68a) Signed-off-by: Fridolin Somers Conflicts: t/db_dependent/Circulation.t --- t/db_dependent/Circulation.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 73c0bf36b5..09a98116c7 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -8,8 +8,9 @@ use C4::Branch; use C4::Items; use C4::Members; use C4::Reserves; +use Koha::DateUtils; -use Test::More tests => 45; +use Test::More tests => 46; BEGIN { use_ok('C4::Circulation'); @@ -347,6 +348,12 @@ C4::Context->dbh->do("DELETE FROM accountlines"); ); ok( $total_due == 15, 'Borrower only charged fine with both WhenLostForgiveFine and WhenLostChargeReplacementFee disabled' ); + + my $now = dt_from_string(); + my $future = dt_from_string(); + $future->add( days => 7 ); + my $units = C4::Overdues::_get_chargeable_units('days', $future, $now, 'MPL'); + ok( $units == 0, '_get_chargeable_units returns 0 for items not past due date' ); } { -- 2.39.5