Bugzilla – Attachment 153635 Details for
Bug 33028
Wrongly formatted monetary amounts in circulation rules break scripts and calculations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33028: Unit tests
Bug-33028-Unit-tests.patch (text/plain), 2.32 KB, created by
Martin Renvoize (ashimema)
on 2023-07-19 10:48:41 UTC
(
hide
)
Description:
Bug 33028: Unit tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-07-19 10:48:41 UTC
Size:
2.32 KB
patch
obsolete
>From 7739364c58894e3affcb07f2c4c28d5172e16eeb Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 19 Jul 2023 11:21:46 +0100 >Subject: [PATCH] Bug 33028: Unit tests > >Add unit tests for is_monetary functionality introduced in the >CirculationRules module. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/CirculationRules.t | 28 ++++++++++++++++++++++++-- > 1 file changed, 26 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/CirculationRules.t b/t/db_dependent/Koha/CirculationRules.t >index 18c8653523..7c8ec68cde 100755 >--- a/t/db_dependent/Koha/CirculationRules.t >+++ b/t/db_dependent/Koha/CirculationRules.t >@@ -153,7 +153,7 @@ subtest 'get_effective_issuing_rule' => sub { > }; > > subtest 'set_rule' => sub { >- plan tests => 3; >+ plan tests => 4; > > $schema->storage->txn_begin; > >@@ -205,7 +205,7 @@ subtest 'set_rule' => sub { > branchcode => $branchcode, > categorycode => $categorycode, > itemtype => $itemtype, >- rule_name => 'fine', >+ rule_name => 'article_requests', > rule_value => '', > } ); > }, 'setting fine with branch/category/itemtype succeeds' ); >@@ -300,6 +300,30 @@ subtest 'set_rule' => sub { > }, qr/categorycode/, 'setting holdallowed with categorycode fails' ); > }; > >+ subtest 'Call with badly formatted params' => sub { >+ plan tests => 4; >+ >+ Koha::CirculationRules->delete; >+ >+ foreach my $monetary_rule ( ( 'article_request_fee', 'fine', 'overduefinescap', 'recall_overdue_fine' ) ) { >+ throws_ok( >+ sub { >+ Koha::CirculationRules->set_rule( >+ { >+ categorycode => '*', >+ branchcode => '*', >+ ( $monetary_rule ne 'article_request_fee' ? ( itemtype => '*' ) : () ), >+ rule_name => $monetary_rule, >+ rule_value => '10,00', >+ } >+ ); >+ }, >+ qr/decimal/, >+ "setting $monetary_rule fails when passed value is not decimal" >+ ); >+ } >+ }; >+ > $schema->storage->txn_rollback; > }; > >-- >2.41.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 33028
:
147058
|
147686
|
147687
|
147688
|
152441
|
152442
|
152443
|
152444
|
152445
|
152446
|
152509
|
152510
|
152511
|
152512
|
152513
|
152514
|
152515
|
152752
|
152753
|
152754
|
152755
|
152756
|
152757
|
152758
|
152759
|
152760
|
152761
|
152762
|
152763
|
152764
|
152803
|
152804
|
152805
|
152829
|
152928
|
152929
|
152930
|
152931
|
152932
|
152933
|
152934
|
152935
|
152936
|
153313
|
153314
|
153315
|
153316
|
153317
|
153318
|
153319
|
153320
|
153321
|
153322
|
153323
|
153619
|
153620
|
153632
|
153633
|
153634
| 153635 |
153636
|
153677