From 6ca2584626ccb65a0f9d79de5ac2233335219401 Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Mon, 4 Jul 2022 09:49:54 -0400 Subject: [PATCH] Bug 30556: (follow-up) Unit tests --- t/db_dependent/Reserves.t | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 91ebbf3f3b..e6eb68ec34 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -1443,7 +1443,7 @@ $schema->storage->txn_rollback(); subtest 'IsAvailableForItemLevelRequest() tests' => sub { - plan tests => 2; + plan tests => 3; $schema->storage->txn_begin; @@ -1475,6 +1475,11 @@ subtest 'IsAvailableForItemLevelRequest() tests' => sub { "Item not available for item-level hold because no effective item type" ); + ok( + !C4::Reserves::IsAvailableForItemLevelRequest( $item, undef ), + "Item not available for item-level hold because no patron defined" + ); + $schema->storage->txn_rollback; }; @@ -1582,7 +1587,7 @@ subtest 'AlterPriorty() tests' => sub { subtest 'CanBookBeReserved() tests' => sub { - plan tests => 2; + plan tests => 3; $schema->storage->txn_begin; @@ -1653,6 +1658,10 @@ subtest 'CanBookBeReserved() tests' => sub { { itemtype => $itype->id } ); is_deeply( $res, { status => '' }, 'Holds on itemtype limit reached' ); + $res = CanBookBeReserved( undef, $biblio->id, $library->id, + { itemtype => $itype->id } ); + is_deeply( $res, { status => '' }, 'Patron id undefined' ); + $schema->storage->txn_rollback; }; -- 2.25.1