Bugzilla – Attachment 153475 Details for
Bug 34279
overduefinescap of 0 is ignored, but overduefinescap of 0.00 is enforced
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34279: Unit tests
Bug-34279-Unit-tests.patch (text/plain), 3.09 KB, created by
Kyle M Hall (khall)
on 2023-07-14 12:17:34 UTC
(
hide
)
Description:
Bug 34279: Unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-07-14 12:17:34 UTC
Size:
3.09 KB
patch
obsolete
>From e8e3171a193ab38ad460de3f8ee4408e3c926690 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 14 Jul 2023 07:32:11 -0400 >Subject: [PATCH] Bug 34279: Unit tests > >--- > t/db_dependent/Circulation/CalcFine.t | 80 ++++++++++++++++++++++++++- > 1 file changed, 79 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/CalcFine.t b/t/db_dependent/Circulation/CalcFine.t >index 23607b3160..628e45b460 100755 >--- 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 => 5; >+use Test::More tests => 7; > use Test::Warn; > > use C4::Context; >@@ -101,6 +101,84 @@ subtest 'Test basic functionality' => sub { > teardown(); > }; > >+subtest 'Overdue fines cap should be disabled when value is 0' => sub { >+ plan tests => 1; >+ >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rules => { >+ fine => '1.00', >+ lengthunit => 'days', >+ finedays => 0, >+ firstremind => 0, >+ chargeperiod => 1, >+ overduefinescap => "0", >+ cap_fine_to_replacement_price => 0, >+ } >+ }, >+ ); >+ >+ 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->unblessed, $patron->{categorycode}, $branch->{branchcode}, $start_dt, $end_dt ); >+ >+ is( $amount, 29, 'Amount is calculated correctly' ); >+ >+ teardown(); >+}; >+ >+subtest 'Overdue fines cap should be disabled when value is 0.00' => sub { >+ plan tests => 1; >+ >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rules => { >+ fine => '1.00', >+ lengthunit => 'days', >+ finedays => 0, >+ firstremind => 0, >+ chargeperiod => 1, >+ overduefinescap => "0.00", >+ cap_fine_to_replacement_price => 0, >+ } >+ }, >+ ); >+ >+ 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->unblessed, $patron->{categorycode}, $branch->{branchcode}, $start_dt, $end_dt ); >+ >+ is( $amount, 29, 'Amount is calculated correctly' ); >+ >+ teardown(); >+}; >+ > subtest 'Test with fine amount empty' => sub { > plan tests => 1; > >-- >2.30.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 34279
:
153471
|
153472
|
153475
|
153476
|
153483
|
153484
|
153485
|
153648
|
153649