From 7af2b88028e09c47313a96f10368c5a07b9a8536 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 24 Feb 2016 16:10:48 +0000 Subject: [PATCH] Bug 15905 - Update unit tests Signed-off-by: Mark Tompsett --- t/db_dependent/Accounts.t | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t index 6d58726..32b94ce 100644 --- a/t/db_dependent/Accounts.t +++ b/t/db_dependent/Accounts.t @@ -24,6 +24,7 @@ use Test::Warn; use t::lib::TestBuilder; +use Koha::Account; use Koha::Account::Lines; use Koha::Account::Line; @@ -36,7 +37,6 @@ BEGIN { can_ok( 'C4::Accounts', qw( - makepayment getnextacctno chargelostitem manualinvoice @@ -305,7 +305,7 @@ subtest "Koha::Account::pay particular line tests" => sub { is( $line4->amountoutstanding, "4.000000", "Line 4 was not paid" ); }; -subtest "makepayment() tests" => sub { +subtest "More Koha::Account::pay tests" => sub { plan tests => 6; @@ -332,13 +332,10 @@ subtest "makepayment() tests" => sub { is( $rs->count(), 1, 'Accountline created' ); + my $account = Koha::Account->new( { patron_id => $borrowernumber } ); + my $line = Koha::Account::Lines->find( $accountline->{ accountlines_id } ); # make the full payment - makepayment( - $accountline->{ accountlines_id }, $borrowernumber, - $accountline->{ accountno }, $amount, - $borrowernumber, $branch, 'A payment note' ); - - # TODO: someone should write actual tests for makepayment() + $account->pay({ lines => [$line], amount => $amount, library_id => $branch, note => 'A payment note' }); my $stat = $schema->resultset('Statistic')->search({ branch => $branch, -- 2.9.3