@@ -, +, @@ --- 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 @@ -1445,7 +1445,7 @@ $schema->storage->txn_rollback(); subtest 'IsAvailableForItemLevelRequest() tests' => sub { - plan tests => 2; + plan tests => 3; $schema->storage->txn_begin; @@ -1477,6 +1477,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; }; @@ -1584,7 +1589,7 @@ subtest 'AlterPriorty() tests' => sub { subtest 'CanBookBeReserved() tests' => sub { - plan tests => 2; + plan tests => 3; $schema->storage->txn_begin; @@ -1655,6 +1660,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; }; --