Bugzilla – Attachment 89608 Details for
Bug 18344
Overdue fines 'cap at replacement price' and 'cap by amount' should work together
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18344: Add unit tests
Bug-18344-Add-unit-tests.patch (text/plain), 2.53 KB, created by
Katrin Fischer
on 2019-05-11 13:43:55 UTC
(
hide
)
Description:
Bug 18344: Add unit tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-05-11 13:43:55 UTC
Size:
2.53 KB
patch
obsolete
>From d4d55bf6f84ace323660244dd6b3fa8253e52288 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 25 Mar 2019 13:55:43 -0400 >Subject: [PATCH] Bug 18344: Add unit tests > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Circulation/CalcFine.t | 46 ++++++++++++++++++++++++++++++++++- > 1 file changed, 45 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/CalcFine.t b/t/db_dependent/Circulation/CalcFine.t >index 24cf5800b7..f9104fe491 100644 >--- a/t/db_dependent/Circulation/CalcFine.t >+++ b/t/db_dependent/Circulation/CalcFine.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 2; >+use Test::More tests => 3; > > use C4::Context; > use C4::Overdues; >@@ -169,6 +169,50 @@ subtest 'Test cap_fine_to_replacement_price' => sub { > teardown(); > }; > >+subtest 'Test cap_fine_to_replacement_pricew with overduefinescap' => sub { >+ plan tests => 2; >+ >+ t::lib::Mocks::mock_preference('useDefaultReplacementCost', '1'); >+ my $issuingrule = $builder->build_object( >+ { >+ class => 'Koha::IssuingRules', >+ value => { >+ branchcode => '*', >+ categorycode => '*', >+ itemtype => '*', >+ fine => '1.00', >+ lengthunit => 'days', >+ finedays => 0, >+ firstremind => 0, >+ chargeperiod => 1, >+ overduefinescap => 3, >+ cap_fine_to_replacement_price => 1, >+ }, >+ } >+ ); >+ >+ my $start_dt = DateTime->new( >+ year => 2000, >+ month => 1, >+ day => 1, >+ ); >+ >+ my $end_dt = DateTime->new( >+ year => 2000, >+ month => 1, >+ day => 30, >+ ); >+ >+ my ($amount) = CalcFine( $item, $patron->{categorycode}, $branch->{branchcode}, $start_dt, $end_dt ); >+ is( int($amount), 3, 'Got the lesser of overduefinescap and replacement price where overduefinescap < replacement price' ); >+ >+ $issuingrule->overduefinescap(6)->store(); >+ ($amount) = CalcFine( $item, $patron->{categorycode}, $branch->{branchcode}, $start_dt, $end_dt ); >+ is( int($amount), 5, 'Get the lesser of overduefinescap and replacement price where overduefinescap > replacement price' ); >+ >+ teardown(); >+}; >+ > sub teardown { > $dbh->do(q|DELETE FROM issuingrules|); > } >-- >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 18344
:
61658
|
62190
|
65493
|
86988
|
86989
|
89607
| 89608