Bugzilla – Attachment 123653 Details for
Bug 25711
Move ExpireReservesMaxPickUpDelayCharge to the circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25711: tests for get_effective_expire_reserves_charge method
Bug-25711-tests-for-geteffectiveexpirereserveschar.patch (text/plain), 3.44 KB, created by
Peter Vashchuk
on 2021-08-09 14:57:52 UTC
(
hide
)
Description:
Bug 25711: tests for get_effective_expire_reserves_charge method
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2021-08-09 14:57:52 UTC
Size:
3.44 KB
patch
obsolete
>From 3574ed84f4a3b65df749e870a27d123bea12b808 Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Mon, 9 Aug 2021 17:45:14 +0300 >Subject: [PATCH] Bug 25711: tests for get_effective_expire_reserves_charge > method > >new tests that test logic of new get_effective_expire_reserves_charge >method that was added to Koha::CirculationRules to retrieve the >effective value of the rule. >--- > t/db_dependent/Koha/CirculationRules.t | 92 +++++++++++++++++++++++++- > 1 file changed, 91 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/CirculationRules.t b/t/db_dependent/Koha/CirculationRules.t >index b621b50cfb..3b437bc31c 100755 >--- a/t/db_dependent/Koha/CirculationRules.t >+++ b/t/db_dependent/Koha/CirculationRules.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 4; >+use Test::More tests => 5; > use Test::Exception; > > use Koha::CirculationRules; >@@ -297,6 +297,96 @@ subtest 'get_effective_daysmode' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'get_effective_expire_reserves_charge' => sub { >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ t::lib::Mocks::mock_preference( 'ExpireReservesMaxPickUpDelayCharge', 10 ); >+ >+ is( >+ Koha::CirculationRules->get_effective_expire_reserves_charge( >+ { >+ itemtype => undef, >+ branchcode => undef, >+ categorycode => undef, >+ } >+ ), >+ '10', >+ 'use the default pref value as the circ rule does not exist' >+ ); >+ >+ Koha::CirculationRules->set_rule( >+ { >+ branchcode => '*', >+ categorycode => '*', >+ itemtype => '*', >+ rule_name => 'expire_reserves_charge', >+ rule_value => '20' >+ } >+ ); >+ >+ is( >+ Koha::CirculationRules->get_effective_expire_reserves_charge( >+ { >+ categorycode => undef, >+ itemtype => undef, >+ branchcode => undef >+ } >+ ), >+ '20', >+ "use the value from the circ rules" >+ ); >+ >+ t::lib::Mocks::mock_preference( 'ExpireReservesMaxPickUpDelayCharge', 30 ); >+ >+ Koha::CirculationRules->set_rule( >+ { >+ branchcode => '*', >+ categorycode => '*', >+ itemtype => '*', >+ rule_name => 'expire_reserves_charge', >+ rule_value => undef >+ } >+ ); >+ >+ is( >+ Koha::CirculationRules->get_effective_expire_reserves_charge( >+ { >+ categorycode => undef, >+ itemtype => undef, >+ branchcode => undef >+ } >+ ), >+ '30', >+ "use the default pref value for as the circ rule has undefined value" >+ ); >+ >+ Koha::CirculationRules->set_rule( >+ { >+ branchcode => '*', >+ categorycode => '*', >+ itemtype => '*', >+ rule_name => 'expire_reserves_charge', >+ rule_value => '0' >+ } >+ ); >+ >+ is( >+ Koha::CirculationRules->get_effective_expire_reserves_charge( >+ { >+ categorycode => undef, >+ itemtype => undef, >+ branchcode => undef >+ } >+ ), >+ '0', >+ "use the value from the circ rules for even though it's 0" >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'get_lostreturn_policy() tests' => sub { > plan tests => 7; > >-- >2.31.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 25711
:
107144
|
107407
|
107683
|
107844
|
108689
|
119851
|
119911
|
119912
|
120164
|
123309
|
123310
|
123326
|
123327
|
123328
|
123452
|
123456
|
123498
|
123568
|
123610
|
123653
|
123661
|
135060
|
135061
|
135062
|
135063
|
135064
|
135065
|
135156
|
135157
|
135158
|
135159
|
135160
|
135161
|
135950
|
135951
|
135952
|
135953
|
135954
|
135955
|
136769
|
140377
|
140378
|
140379
|
140380
|
140381
|
140382
|
140383
|
141270
|
157632
|
157633
|
157634
|
157635
|
157636
|
157637
|
157638
|
157639
|
171054
|
171055
|
171056
|
171057
|
171058
|
171059
|
176243
|
176244
|
176245
|
176246
|
176247
|
176248
|
176408
|
176409
|
176410
|
176411
|
176412
|
176413
|
176414
|
176415
|
176416
|
176417
|
176418
|
176419
|
176420
|
176421