Bugzilla – Attachment 153640 Details for
Bug 32271
Overdue fines cap (amount) set to 0.00 when editing rule
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32271: Unit test
Bug-32271-Unit-test.patch (text/plain), 2.46 KB, created by
Martin Renvoize
on 2023-07-19 11:42:31 UTC
(
hide
)
Description:
Bug 32271: Unit test
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2023-07-19 11:42:31 UTC
Size:
2.46 KB
patch
obsolete
>From ff097bfddf2863ce6f7dcb125167928e03e3f9ac Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 19 Jul 2023 12:11:50 +0100 >Subject: [PATCH] Bug 32271: Unit test > >Add a unit test for the allow blank option added to the monetary check >in CirculationRules. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/CirculationRules.t | 30 +++++++++++++++++++++++--- > 1 file changed, 27 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/CirculationRules.t b/t/db_dependent/Koha/CirculationRules.t >index 7c8ec68cde..90eb827aff 100755 >--- a/t/db_dependent/Koha/CirculationRules.t >+++ b/t/db_dependent/Koha/CirculationRules.t >@@ -441,7 +441,7 @@ subtest 'clone' => sub { > }; > > subtest 'set_rule + get_effective_rule' => sub { >- plan tests => 9; >+ plan tests => 10; > > $schema->storage->txn_begin; > >@@ -534,6 +534,30 @@ subtest 'set_rule + get_effective_rule' => sub { > } > }; > >+ subtest 'test rules that can be blank' => sub { >+ plan tests => 1; >+ foreach my $blank_rule ( ('overduefinescap') ) { >+ Koha::CirculationRules->set_rule( >+ { >+ branchcode => $branchcode, >+ categorycode => '*', >+ itemtype => '*', >+ rule_name => $blank_rule, >+ rule_value => '', >+ } >+ ); >+ >+ $rule = Koha::CirculationRules->get_effective_rule( >+ { >+ branchcode => $branchcode, >+ categorycode => undef, >+ itemtype => undef, >+ rule_name => $blank_rule, >+ } >+ ); >+ is( $rule->rule_value, '', "$blank_rule allowed to be set to blank" ); >+ } >+ }; > > subtest 'test rule matching with different combinations of rule scopes' => sub { > my ( $tests, $order ) = _prepare_tests_for_rule_scope_combinations( >@@ -575,9 +599,9 @@ subtest 'set_rule + get_effective_rule' => sub { > }; > > my $our_branch_rules = Koha::CirculationRules->search({branchcode => $branchcode}); >- is( $our_branch_rules->count, 4, "We added 8 rules"); >+ is( $our_branch_rules->count, 5, "We added 9 rules"); > $our_branch_rules->delete; >- is( $our_branch_rules->count, 0, "We deleted 8 rules"); >+ is( $our_branch_rules->count, 0, "We deleted 9 rules"); > > $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 32271
:
144430
|
144528
|
153486
|
153487
|
153488
|
153489
|
153638
|
153639
| 153640 |
153641
|
153642