From dd2629127a337b92182421eb3c65263b9754ec5a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 23 Apr 2025 12:15:52 +0000 Subject: [PATCH] Bug 39710: Unit test --- t/db_dependent/api/v1/patrons_holds.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/api/v1/patrons_holds.t b/t/db_dependent/api/v1/patrons_holds.t index 569db8e1786..99066428fd1 100755 --- a/t/db_dependent/api/v1/patrons_holds.t +++ b/t/db_dependent/api/v1/patrons_holds.t @@ -36,7 +36,7 @@ t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); subtest 'list() tests' => sub { - plan tests => 18; + plan tests => 21; $schema->storage->txn_begin; @@ -81,6 +81,13 @@ subtest 'list() tests' => sub { 'Old holds even after item and library removed' ); + $old_hold_1->biblio->delete; + $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id . '/holds?old=1&_order_by=+me.hold_id' ) + ->status_is( 200, 'REST3.2.2' )->json_is( + '' => [ $old_hold_1->get_from_storage->to_api, $hold_3->to_api ], + 'Old holds even after biblio removed' + ); + my $non_existent_patron = $builder->build_object( { class => 'Koha::Patrons' } ); my $non_existent_patron_id = $non_existent_patron->id; -- 2.39.5