@@ -, +, @@ --- t/db_dependent/Reserves.t | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) --- a/t/db_dependent/Reserves.t +++ a/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; }; --