Bugzilla – Attachment 58909 Details for
Bug 17894
Remove and Replace WriteOffFee
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 17894 - Add unit tests
SIGNED-OFF-Bug-17894---Add-unit-tests.patch (text/plain), 2.23 KB, created by
Josef Moravec
on 2017-01-13 06:26:43 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 17894 - Add unit tests
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-01-13 06:26:43 UTC
Size:
2.23 KB
patch
obsolete
>From e593a51c4ea9576442a2529b334a083b587b43d7 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 12 Jan 2017 14:41:53 +0000 >Subject: [PATCH] [SIGNED-OFF] Bug 17894 - Add unit tests > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > t/db_dependent/Accounts.t | 44 +++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 43 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index fe3100c..d1cc6db 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -18,7 +18,7 @@ > > use Modern::Perl; > >-use Test::More tests => 21; >+use Test::More tests => 22; > use Test::MockModule; > use Test::Warn; > >@@ -303,6 +303,48 @@ subtest "Koha::Account::pay particular line tests" => sub { > is( $line4->amountoutstanding, "4.000000", "Line 4 was not paid" ); > }; > >+subtest "Koha::Account::pay writeoff tests" => sub { >+ >+ plan tests => 5; >+ >+ # Create a borrower >+ my $categorycode = $builder->build({ source => 'Category' })->{ categorycode }; >+ my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode }; >+ >+ my $borrower = Koha::Patron->new( { >+ cardnumber => 'chelseahall', >+ surname => 'Hall', >+ firstname => 'Chelsea', >+ } ); >+ $borrower->categorycode( $categorycode ); >+ $borrower->branchcode( $branchcode ); >+ $borrower->store; >+ >+ my $account = Koha::Account->new({ patron_id => $borrower->id }); >+ >+ my $line = Koha::Account::Line->new({ borrowernumber => $borrower->borrowernumber, amountoutstanding => 42 })->store(); >+ >+ is( $account->balance(), "42.000000", "Account balance is 42" ); >+ >+ my $id = $account->pay( >+ { >+ lines => [$line], >+ amount => 42, >+ type => 'writeoff', >+ } >+ ); >+ >+ $line->_result->discard_changes(); >+ >+ is( $line->amountoutstanding, "0.000000", "Line was written off" ); >+ >+ my $writeoff = Koha::Account::Lines->find( $id ); >+ >+ is( $writeoff->accounttype, 'W', 'Type is correct' ); >+ is( $writeoff->description, 'Writeoff', 'Description is correct' ); >+ is( $writeoff->amount, '-42.000000', 'Amount is correct' ); >+}; >+ > subtest "More Koha::Account::pay tests" => sub { > > plan tests => 6; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17894
:
58883
|
58884
|
58885
|
58908
|
58909
|
58910
|
59211
|
59212
|
59213