From 09152cdb4fdad492ab0330e5d3f8ed247bbf4832 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 12 Jun 2019 09:12:23 -0500 Subject: [PATCH] Bug 23104: Add tests --- t/db_dependent/Circulation/TooMany.t | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Circulation/TooMany.t b/t/db_dependent/Circulation/TooMany.t index ae8bb03cbb..0a574ce0d2 100644 --- a/t/db_dependent/Circulation/TooMany.t +++ b/t/db_dependent/Circulation/TooMany.t @@ -15,7 +15,7 @@ # with Koha; if not, see . use Modern::Perl; -use Test::More tests => 8; +use Test::More tests => 9; use C4::Context; use C4::Members; @@ -654,9 +654,29 @@ subtest 'General vs specific rules limit quantity correctly' => sub { undef, 'We are allowed one from the branch specifically now' ); +}; +subtest 'empty string means unlimited' => sub { + plan tests => 1; + Koha::CirculationRules->set_rules( + { + branchcode => '*', + categorycode => '*', + itemtype => '*', + rules => { + maxissueqty => '', + maxonsiteissueqty => 0, + } + }, + ); + is( + C4::Circulation::TooMany( $patron, $biblio->{biblionumber}, $item ), + undef, + 'maxissueqty="" should mean unlimited' + ); + teardown(); }; $schema->storage->txn_rollback; -- 2.11.0