From 045fe0cd8ec8af93a7cc439dc72aa606341310b2 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 31 Jul 2013 10:26:35 -0400 Subject: [PATCH] Bug 7560 - SIP Self Checkout Ignoring Fines Thresholds for Not Being able to Check Out Books - Unit Test --- t/db_dependent/Accounts.t | 34 +++++++++++++++++++++++++++++++--- 1 files changed, 31 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t index 1c2dd5a..e7b21d3 100644 --- a/t/db_dependent/Accounts.t +++ b/t/db_dependent/Accounts.t @@ -3,14 +3,42 @@ # This Koha test module is a stub! # Add more tests here!!! -use strict; -use warnings; +use Modern::Perl; -use Test::More tests => 1; +use Test::More tests => 2; BEGIN { use_ok('C4::Accounts'); } +my $dbh = C4::Context->dbh; +# Start transaction +$dbh->{AutoCommit} = 0; +$dbh->{RaiseError} = 1; + +$dbh->do(q{ +INSERT INTO accountlines ( + borrowernumber , + accountno , + itemnumber , + date , + amount , + description , + dispute , + accounttype , + amountoutstanding , + lastincrement , + timestamp , + notify_id , + notify_level , + note , + manager_id + ) +VALUES + ('1', '32766', NULL , '2013-07-31', '1.000000', NULL , NULL , NULL , '1.000000', NULL , '2013-07-31 10:21:01', '0', '0', NULL , NULL), + ('1', '32767', NULL , '2013-07-31', '2.000000', NULL , NULL , NULL , '2.000000', NULL , '2013-07-31 10:21:01', '0', '0', NULL , NULL) +}); + +ok( GetTotalFines( 1 ) == 3, "GetTotalFines functions correctly" ); -- 1.7.2.5