Bugzilla – Attachment 108587 Details for
Bug 19036
Number payment receipts / payment slips
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19036: (follow-up) Improve test output
Bug-19036-follow-up-Improve-test-output.patch (text/plain), 3.89 KB, created by
Martin Renvoize (ashimema)
on 2020-08-19 11:20:19 UTC
(
hide
)
Description:
Bug 19036: (follow-up) Improve test output
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-08-19 11:20:19 UTC
Size:
3.89 KB
patch
obsolete
>From 48984539c95d2e898bf3f3fc5cc733e6f8ee915f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 19 Aug 2020 12:17:32 +0100 >Subject: [PATCH] Bug 19036: (follow-up) Improve test output > >This patch adds proper detail to the test output for the newly >introduced AutoCreditNumber feature and fixes the final test by adding >the 'interface' and 'amount' parameters to the Koha::Account::Line being >created so that we reach the Exception we are trying to catch and don't >die early. >--- > t/db_dependent/Koha/Account.t | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index 493e1ba639..9b37a08f8a 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -1084,42 +1084,44 @@ subtest 'Koha::Account::pay() generates credit number (Koha::Account::Line->stor > for my $i (1..11) { > $accountlines_id = $account->pay({ amount => '1.00', library_id => $library->id })->{payment_id}; > $accountline = Koha::Account::Lines->find($accountlines_id); >- is($accountline->credit_number, $i); >+ is($accountline->credit_number, $i, "Incremental format credit number added for payments: $i"); > } > $accountlines_id = $account->pay({ type => 'WRITEOFF', amount => '1.00', library_id => $library->id })->{payment_id}; > $accountline = Koha::Account::Lines->find($accountlines_id); >- is($accountline->credit_number, undef); >+ is($accountline->credit_number, undef, "Incremental credit number not added for writeoff"); > > t::lib::Mocks::mock_preference('AutoCreditNumber', 'annual'); > for my $i (1..11) { > $accountlines_id = $account->pay({ amount => '1.00', library_id => $library->id })->{payment_id}; > $accountline = Koha::Account::Lines->find($accountlines_id); >- is($accountline->credit_number, sprintf('%s-%04d', $year, $i)); >+ is($accountline->credit_number, sprintf('%s-%04d', $year, $i), "Annual format credit number added for payments: " . sprintf('%s-%04d', $year, $i)); > } > $accountlines_id = $account->pay({ type => 'WRITEOFF', amount => '1.00', library_id => $library->id })->{payment_id}; > $accountline = Koha::Account::Lines->find($accountlines_id); >- is($accountline->credit_number, undef); >+ is($accountline->credit_number, undef, "Annual format credit number not aded for writeoff"); > > t::lib::Mocks::mock_preference('AutoCreditNumber', 'branchyyyymmincr'); > for my $i (1..11) { > $accountlines_id = $account->pay({ amount => '1.00', library_id => $library->id })->{payment_id}; > $accountline = Koha::Account::Lines->find($accountlines_id); >- is($accountline->credit_number, sprintf('%s%d%02d%04d', $library->id, $year, $month, $i)); >+ is($accountline->credit_number, sprintf('%s%d%02d%04d', $library->id, $year, $month, $i), "branchyyyymmincr format credit number added for payment: " . sprintf('%s%d%02d%04d', $library->id, $year, $month, $i)); > } > $accountlines_id = $account->pay({ type => 'WRITEOFF', amount => '1.00', library_id => $library->id })->{payment_id}; > $accountline = Koha::Account::Lines->find($accountlines_id); >- is($accountline->credit_number, undef); >+ is($accountline->credit_number, undef, "branchyyyymmincr format credit number not added for writeoff"); > > throws_ok { > Koha::Account::Line->new( > { >+ interface => 'test', >+ amount => -1, > credit_type_code => $credit_type->code, > credit_number => 42 > } > )->store; > } >- qr/AutoCreditNumber is enabled but credit_number is already defined!/, >- 'Croaked on bad call to store'; >+ 'Koha::Exceptions::Account', >+"Exception thrown when AutoCreditNumber is enabled but credit_number is already defined"; > > $schema->storage->txn_rollback; > }; >-- >2.20.1
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 19036
:
99301
|
99302
|
99303
|
99676
|
101549
|
101550
|
101896
|
101897
|
106278
|
106279
|
106280
|
106281
|
106767
|
107872
|
107875
|
107877
|
108323
|
108324
|
108325
|
108326
|
108327
|
108328
|
108329
|
108525
| 108587 |
108733