Bugzilla – Attachment 74817 Details for
Bug 2696
Fine payments should show what was paid for
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2696 [QA Followup]: Add more test, move to subtest
Bug-2696-QA-Followup-Add-more-test-move-to-subtest.patch (text/plain), 3.54 KB, created by
Kyle M Hall
on 2018-04-24 16:43:44 UTC
(
hide
)
Description:
Bug 2696 [QA Followup]: Add more test, move to subtest
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2018-04-24 16:43:44 UTC
Size:
3.54 KB
patch
obsolete
>From f71cd7f274d079ecd4e814a4d478cc773fc4fbfb Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 24 Apr 2018 16:43:25 +0000 >Subject: [PATCH] Bug 2696 [QA Followup]: Add more test, move to subtest > >--- > t/db_dependent/Accounts.t | 56 +++++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 49 insertions(+), 7 deletions(-) > >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index 541564e92c..ab1fc5fe01 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -18,7 +18,7 @@ > > use Modern::Perl; > >-use Test::More tests => 26; >+use Test::More tests => 27; > use Test::MockModule; > use Test::Warn; > >@@ -846,7 +846,7 @@ subtest "Koha::Account::non_issues_charges tests" => sub { > > subtest "Koha::Account::Line::void tests" => sub { > >- plan tests => 14; >+ plan tests => 12; > > # Create a borrower > my $categorycode = $builder->build({ source => 'Category' })->{ categorycode }; >@@ -877,11 +877,6 @@ subtest "Koha::Account::Line::void tests" => sub { > } > ); > >- # Test debit and credit methods fo Koha::Account::Offset >- my $account_offset = Koha::Account::Offsets->find( { credit_id => $id, debit_id => $line1->id } ); >- is( $account_offset->debit->id, $line1->id, "Koha::Account::Offset->debit gets correct accountline" ); >- is( $account_offset->credit->id, $id, "Koha::Account::Offset->credit gets correct accountline" ); >- > my $account_payment = Koha::Account::Lines->find( $id ); > > is( $account->balance(), 0, "Account balance is 0" ); >@@ -907,4 +902,51 @@ subtest "Koha::Account::Line::void tests" => sub { > is( $line2->amountoutstanding+0, 20, 'Second fee again has amount outstanding of 20' ); > }; > >+subtest "Koha::Account::Offset credit & debit tests" => sub { >+ >+ plan tests => 4; >+ >+ # Create a borrower >+ my $categorycode = $builder->build({ source => 'Category' })->{ categorycode }; >+ my $branchcode = $builder->build({ source => 'Branch' })->{ branchcode }; >+ >+ my $borrower = Koha::Patron->new( { >+ cardnumber => 'kyliehall', >+ surname => 'Hall', >+ firstname => 'Kylie', >+ } ); >+ $borrower->categorycode( $categorycode ); >+ $borrower->branchcode( $branchcode ); >+ $borrower->store; >+ >+ my $account = Koha::Account->new({ patron_id => $borrower->id }); >+ >+ my $line1 = Koha::Account::Line->new({ borrowernumber => $borrower->borrowernumber, amount => 10, amountoutstanding => 10 })->store(); >+ my $line2 = Koha::Account::Line->new({ borrowernumber => $borrower->borrowernumber, amount => 20, amountoutstanding => 20 })->store(); >+ >+ my $id = $account->pay( >+ { >+ lines => [$line1, $line2], >+ amount => 30, >+ } >+ ); >+ >+ # Test debit and credit methods for Koha::Account::Offset >+ my $account_offset = Koha::Account::Offsets->find( { credit_id => $id, debit_id => $line1->id } ); >+ is( $account_offset->debit->id, $line1->id, "Koha::Account::Offset->debit gets correct accountline" ); >+ is( $account_offset->credit->id, $id, "Koha::Account::Offset->credit gets correct accountline" ); >+ >+ $account_offset = Koha::Account::Offset->new( >+ { >+ credit_id => undef, >+ debit_id => undef, >+ type => 'Payment', >+ amount => 0, >+ } >+ )->store(); >+ >+ is( $account_offset->debit, undef, "Koha::Account::Offset->debit returns undef if no associated debit" ); >+ is( $account_offset->credit, undef, "Koha::Account::Offset->credit returns undef if no associated credit" ); >+}; >+ > 1; >-- >2.15.1 (Apple Git-101)
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 2696
:
800
|
3069
|
9583
|
64287
|
64293
|
64342
|
64345
|
64346
|
64350
|
67479
|
70031
|
72024
|
72088
|
72263
|
74672
|
74673
|
74674
|
74765
| 74817