Bugzilla – Attachment 82919 Details for
Bug 21849
Offsets not stored correctly in _FixOverduesOnReturn
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21849: Add unit tests
Bug-21849-Add-unit-tests.patch (text/plain), 2.23 KB, created by
Tomás Cohen Arazi
on 2018-12-06 16:03:03 UTC
(
hide
)
Description:
Bug 21849: Add unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2018-12-06 16:03:03 UTC
Size:
2.23 KB
patch
obsolete
>From e5539aee624e41773901683efea71bd8b3f501a7 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 16 Nov 2018 09:54:39 -0500 >Subject: [PATCH] Bug 21849: Add unit tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Circulation.t | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index d5a74286c4..165feb29f0 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2292,7 +2292,7 @@ subtest '_FixAccountForLostAndReturned' => sub { > }; > > subtest '_FixOverduesOnReturn' => sub { >- plan tests => 6; >+ plan tests => 10; > > # Generate test biblio > my $title = 'Koha for Dummies'; >@@ -2345,9 +2345,12 @@ subtest '_FixOverduesOnReturn' => sub { > C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 1 ); > > $accountline->_result()->discard_changes(); >+ my $offset = Koha::Account::Offsets->search({ debit_id => $accountline->id, type => 'Forgiven' })->next(); > > is( $accountline->amountoutstanding + 0, 0, 'Fine has been reduced to 0' ); > is( $accountline->accounttype, 'FFOR', 'Open fine ( account type FU ) has been set to fine forgiven ( account type FFOR )'); >+ is( ref $offset, "Koha::Account::Offset", "Found matching offset for fine reduction via forgiveness" ); >+ is( $offset->amount, '-99.000000', "Amount of offset is correct" ); > > ## Run again, with dropbox mode enabled > $accountline->set( >@@ -2360,9 +2363,12 @@ subtest '_FixOverduesOnReturn' => sub { > C4::Circulation::_FixOverduesOnReturn( $patron->{borrowernumber}, $itemnumber, 0, 1 ); > > $accountline->_result()->discard_changes(); >+ $offset = Koha::Account::Offsets->search({ debit_id => $accountline->id, type => 'Dropbox' })->next(); > > is( $accountline->amountoutstanding + 0, 90, 'Fine has been reduced to 90' ); > is( $accountline->accounttype, 'F', 'Open fine ( account type FU ) has been closed out ( account type F )'); >+ is( ref $offset, "Koha::Account::Offset", "Found matching offset for fine reduction via dropbox" ); >+ is( $offset->amount, '-9.000000', "Amount of offset is correct" ); > }; > > subtest 'Set waiting flag' => sub { >-- >2.19.2
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 21849
:
82397
|
82404
|
82919
|
82920
|
82947
|
82948