From c93f09fdc40d49c09f8bd873326bf07a4d9d21ba Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Thu, 7 Feb 2019 17:22:17 +0100 Subject: [PATCH] Bug 21738: unit tests for HoldTitle --- t/db_dependent/ILSDI_Services.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t index 049a8f8..4ec7f81 100644 --- a/t/db_dependent/ILSDI_Services.t +++ b/t/db_dependent/ILSDI_Services.t @@ -299,7 +299,7 @@ subtest 'LookupPatron test' => sub { subtest 'Holds test' => sub { - plan tests => 4; + plan tests => 5; $schema->storage->txn_begin; @@ -350,6 +350,17 @@ subtest 'Holds test' => sub { $reply = C4::ILSDI::Services::HoldTitle( $query ); is( $reply->{code}, 'itemAlreadyOnHold', "Item already on hold" ); + my $biblio_with_no_item = $builder->build({ + source => 'Biblio', + }); + + $query = new CGI; + $query->param( 'patron_id', $patron->{borrowernumber}); + $query->param( 'bib_id', $biblio_with_no_item->{biblionumber}); + + $reply = C4::ILSDI::Services::HoldTitle( $query ); + is( $reply->{code}, 'NoItems', 'Biblio has no item' ); + my $biblio2 = $builder->build({ source => 'Biblio', }); -- 2.7.4