Bugzilla – Attachment 102826 Details for
Bug 25127
Fines with an amountoutstanding of 0 can be created due to maxFine but cannot be forgiven
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25127: Unit tests
Bug-25127-Unit-tests.patch (text/plain), 2.33 KB, created by
Nick Clemens (kidclamp)
on 2020-04-13 12:47:41 UTC
(
hide
)
Description:
Bug 25127: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-04-13 12:47:41 UTC
Size:
2.33 KB
patch
obsolete
>From 707e12eff69c61d604c9e35c04381d3ef841e21d Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 13 Apr 2020 12:47:03 +0000 >Subject: [PATCH] Bug 25127: Unit tests > >--- > t/db_dependent/Overdues.t | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t >index 5305066f84..5118619e5b 100644 >--- a/t/db_dependent/Overdues.t >+++ b/t/db_dependent/Overdues.t >@@ -132,7 +132,7 @@ $schema->storage->txn_rollback; > > subtest 'UpdateFine tests' => sub { > >- plan tests => 68; >+ plan tests => 70; > > $schema->storage->txn_begin; > >@@ -430,5 +430,36 @@ subtest 'UpdateFine tests' => sub { > is( $fine3->amount+0, 30, "Third fine reduced" ); > is( $fine3->amountoutstanding+0, 10, "Third fine amount outstanding is reduced" ); > >+ t::lib::Mocks::mock_preference( 'MaxFine', '7.2' ); >+ my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $account = $patron_1->account; >+ $account->add_debit({ type => 'OVERDUE', amount => '6.99', interface => 'TEST'}); >+ $account->add_debit({ type => 'OVERDUE', amount => '.10', interface => 'TEST'}); >+ $account->add_debit({ type => 'OVERDUE', amount => '.10', interface => 'TEST'}); >+ $account->add_debit({ type => 'OVERDUE', amount => '.01', interface => 'TEST'}); >+ my $item_1 = $builder->build_sample_item(); >+ my $checkout_1 = $builder->build_object( >+ { >+ class => 'Koha::Checkouts', >+ value => { itemnumber => $item_1->itemnumber, borrowernumber => $patron_1->id } >+ } >+ ); >+ UpdateFine( >+ { >+ issue_id => $checkout_1->issue_id, >+ itemnumber => $item_1->itemnumber, >+ borrowernumber => $patron_1->borrowernumber, >+ amount => '.1', >+ due => $checkout_1->date_due >+ } >+ ); >+ $fines = Koha::Account::Lines->search( >+ { borrowernumber => $patron_1->borrowernumber }, >+ { order_by => { '-asc' => 'accountlines_id' } } >+ ); >+ is( $fines->count, 4, "New amount should be 0 so no fine added" ); >+ ok( C4::Circulation::AddReturn( $item_1->barcode, $item_1->homebranch, 1), "Returning the item and forgiving fines succeeds"); >+ >+ > $schema->storage->txn_rollback; > }; >-- >2.11.0
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 25127
:
102826
|
103235
|
103249
|
103253
|
103276
|
103325
|
103326
|
103327
|
103430
|
103431
|
103432
|
104078
|
104079
|
104080