Bug 23104: Add tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 12 Jun 2019 14:12:23 +0000 (09:12 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 18 Jun 2019 09:01:41 +0000 (10:01 +0100)
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

t/db_dependent/Circulation/TooMany.t

index 1f1c6a7..577a0da 100644 (file)
@@ -15,7 +15,7 @@
 # with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
-use Test::More tests => 8;
+use Test::More tests => 9;
 use C4::Context;
 
 use C4::Members;
@@ -658,9 +658,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;