Bugzilla – Attachment 135228 Details for
Bug 30788
Argument "" isn't numeric in multiplication (*) at /usr/share/koha/lib/C4/Overdues.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30788: Unit test
Bug-30788-Unit-test.patch (text/plain), 2.09 KB, created by
Martin Renvoize (ashimema)
on 2022-05-20 08:50:52 UTC
(
hide
)
Description:
Bug 30788: Unit test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-05-20 08:50:52 UTC
Size:
2.09 KB
patch
obsolete
>From 5a437e289d1d1ec1d75984b17c4f0f520e15ce4d Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Fri, 20 May 2022 08:05:43 +0000 >Subject: [PATCH] Bug 30788: Unit test > >Run: > prove t/db_dependent/Circulation/CalcFine.t > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Circulation/CalcFine.t | 43 ++++++++++++++++++++++++++- > 1 file changed, 42 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation/CalcFine.t b/t/db_dependent/Circulation/CalcFine.t >index d89c656e05..dc6b386d57 100755 >--- a/t/db_dependent/Circulation/CalcFine.t >+++ b/t/db_dependent/Circulation/CalcFine.t >@@ -2,7 +2,8 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; >+use Test::Warn; > > use C4::Context; > use C4::Overdues qw( CalcFine ); >@@ -100,6 +101,46 @@ subtest 'Test basic functionality' => sub { > teardown(); > }; > >+subtest 'Test with fine amount empty' => sub { >+ plan tests => 2; >+ >+ Koha::CirculationRules->set_rules( >+ { >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => undef, >+ rules => { >+ fine => '', >+ lengthunit => 'days', >+ finedays => 0, >+ firstremind => 0, >+ chargeperiod => 1, >+ overduefinescap => undef, >+ 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, >+ ); >+ >+ warning_is { >+ my ($amount) = CalcFine( $item->unblessed, $patron->{categorycode}, $branch->{branchcode}, $start_dt, $end_dt ); >+ } >+ undef, "No warning when fine amount is ''"; >+ >+ teardown(); >+}; >+ > subtest 'Test cap_fine_to_replacement_price' => sub { > plan tests => 2; > >-- >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 30788
:
135225
|
135226
|
135227
|
135228
|
135229
|
135554