Bugzilla – Attachment 120220 Details for
Bug 28144
Historical OVERDUE fines may not have an issue_id
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28144: Add a regression test
Bug-28144-Add-a-regression-test.patch (text/plain), 1.95 KB, created by
Jonathan Druart
on 2021-04-27 13:04:58 UTC
(
hide
)
Description:
Bug 28144: Add a regression test
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-04-27 13:04:58 UTC
Size:
1.95 KB
patch
obsolete
>From 3334b47acfdf1082f70e2ba08d676737317e60ed Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 27 Apr 2021 15:04:35 +0200 >Subject: [PATCH] Bug 28144: Add a regression test > >--- > t/db_dependent/Overdues.t | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t >index f58d1bb0eb7..ed031b2932e 100755 >--- a/t/db_dependent/Overdues.t >+++ b/t/db_dependent/Overdues.t >@@ -2,6 +2,7 @@ > > use Modern::Perl; > use Test::More tests => 17; >+use Test::Warn; > > use C4::Context; > use Koha::Database; >@@ -132,7 +133,7 @@ $schema->storage->txn_rollback; > > subtest 'UpdateFine tests' => sub { > >- plan tests => 74; >+ plan tests => 75; > > $schema->storage->txn_begin; > >@@ -536,5 +537,29 @@ subtest 'UpdateFine tests' => sub { > my $refunds = Koha::Account::Lines->search({ itemnumber => $item_2->itemnumber, credit_type_code => 'OVERPAYMENT' }); > is( $refunds->count, 0, "Overpayment refund not added when the amounts are equal" ); > >+ # Adding an OVERDUE fine not linked with a checkout (possible with historical OVERDUE fines) >+ $builder->build_object( >+ { >+ class => "Koha::Account::Lines", >+ value => { >+ borrowernumber => $patron_1->borrowernumber, >+ issue_id => undef, >+ debit_type_code => 'OVERDUE', >+ } >+ } >+ ); >+ $fine->issue_id(undef)->store; >+ warnings_are { >+ UpdateFine( >+ { >+ issue_id => $checkout_2->issue_id, >+ itemnumber => $item_2->itemnumber, >+ borrowernumber => $patron_1->borrowernumber, >+ amount => $amount, >+ due => $checkout_2->date_due >+ } >+ ); >+ } [], 'No warning generated if fine is not linked with a checkout'; >+ > $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 28144
:
119541
|
120175
| 120220