Bugzilla – Attachment 110857 Details for
Bug 26529
Holds rules enforced incorrectly when not set at library level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26529: Unit tests
Bug-26529-Unit-tests.patch (text/plain), 2.22 KB, created by
Nick Clemens (kidclamp)
on 2020-09-28 13:54:55 UTC
(
hide
)
Description:
Bug 26529: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-09-28 13:54:55 UTC
Size:
2.22 KB
patch
obsolete
>From 68a9ae717851a03677f793dd11645ce4561177be Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 28 Sep 2020 13:39:48 +0000 >Subject: [PATCH] Bug 26529: Unit tests > >This tests tries to set some rules to blank, and then fetch the effective rule - nothing should be >returned as these values are 'Not set' > >To test: >1 - Apply just this patch >2 - Tests fail >3 - Apply second patch >4 - Tests pass >--- > t/db_dependent/Koha/CirculationRules.t | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/CirculationRules.t b/t/db_dependent/Koha/CirculationRules.t >index 708168a048..cc5468e7eb 100755 >--- a/t/db_dependent/Koha/CirculationRules.t >+++ b/t/db_dependent/Koha/CirculationRules.t >@@ -33,7 +33,7 @@ my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; > > subtest 'set_rule + get_effective_rule' => sub { >- plan tests => 8; >+ plan tests => 9; > > $schema->storage->txn_begin; > >@@ -102,6 +102,31 @@ subtest 'set_rule + get_effective_rule' => sub { > is( $rule->rule_value, 1, > 'Default rule is returned if there is no rule for this branchcode' ); > >+ subtest 'test rules that cannot be blank' => sub { >+ plan tests => 3; >+ foreach my $no_blank_rule ( ('holdallowed','hold_fulfillment_policy','returnbranch') ){ >+ Koha::CirculationRules->set_rule( >+ { >+ branchcode => $branchcode, >+ itemtype => '*', >+ rule_name => $no_blank_rule, >+ rule_value => '', >+ } >+ ); >+ >+ $rule = Koha::CirculationRules->get_effective_rule( >+ { >+ branchcode => $branchcode, >+ categorycode => undef, >+ itemtype => undef, >+ rule_name => $no_blank_rule, >+ } >+ ); >+ is( $rule, undef, 'Rules that cannot be blank are not set when passed blank string' ); >+ } >+ }; >+ >+ > subtest 'test rule matching with different combinations of rule scopes' => sub { > my ( $tests, $order ) = prepare_tests_for_rule_scope_combinations( > { >-- >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 26529
:
110686
|
110687
|
110695
|
110714
|
110715
|
110856
|
110857
|
110859
|
111251
|
111252
|
111253
|
111382
|
111471
|
111511