From 7fafbf42012000c52007f574ca6d83060c96c32d 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 | 47 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 46 insertions(+), 1 deletions(-) diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t index cefbb3b..95a3df2 100644 --- a/t/db_dependent/Accounts.t +++ b/t/db_dependent/Accounts.t @@ -18,7 +18,7 @@ use Modern::Perl; -use Test::More tests => 8; +use Test::More tests => 9; use Test::MockModule; use Test::Warn; @@ -291,6 +291,51 @@ subtest "makepartialpayment() tests" => sub { } }; +subtest "makepartialpayment() tests" => sub { + + plan tests => 1; + + my $categorycode = $builder->build( { source => 'Category' } )->{categorycode}; + + my $borrower = Koha::Borrower->new( + { + surname => 'Hall', + firstname => 'Kyle', + categorycode => $categorycode, + branchcode => $branchcode, + } + )->store(); + + my $sth = $dbh->prepare( + q{ +INSERT INTO accountlines ( + borrowernumber , + accountno , + itemnumber , + date , + amount , + description , + dispute , + accounttype , + amountoutstanding , + lastincrement , + timestamp , + notify_id , + notify_level , + note , + manager_id + ) +VALUES + ( ?, '32766', NULL , '2013-07-31', '1.000000', NULL , NULL , NULL , '1.000000', NULL , '2013-07-31 10:21:01', '0', '0', NULL , NULL), + ( ?, '32767', NULL , '2013-07-31', '2.000000', NULL , NULL , NULL , '2.000000', NULL , '2013-07-31 10:21:01', '0', '0', NULL , NULL) +} + ); + $sth->execute( $borrower->borrowernumber, $borrower->borrowernumber ); + + ok( GetTotalFines( $borrower->borrowernumber ) == 3, "GetTotalFines functions correctly" ); +}; + $dbh->rollback; 1; + -- 1.7.2.5