From 2a3f2528977d85efb4a092ca19bb93ef35dbdaa8 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Wed, 12 Oct 2022 13:20:59 -0400 Subject: [PATCH] Bug 24860: (QA follow-up) Add unit tests to cover Koha::Holds::forced_hold_level --- t/db_dependent/Reserves/MultiplePerRecord.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Reserves/MultiplePerRecord.t b/t/db_dependent/Reserves/MultiplePerRecord.t index 07f7ea9aba..d37b8517b9 100755 --- a/t/db_dependent/Reserves/MultiplePerRecord.t +++ b/t/db_dependent/Reserves/MultiplePerRecord.t @@ -19,7 +19,7 @@ use Modern::Perl; -use Test::More tests => 16; +use Test::More tests => 17; use t::lib::TestBuilder; use t::lib::Mocks; @@ -205,6 +205,14 @@ $hold->store(); $holds = Koha::Holds->search( { borrowernumber => $patron->{borrowernumber} } ); is( $holds->forced_hold_level, 'item', "Item level hold forces item level holds" ); +my $item_group = Koha::Biblio::ItemGroup->new( { biblio_id => $biblio->id } )->store(); +$hold->itemnumber( undef ); +$hold->item_group_id( $item_group->id ); +$hold->store(); + +$holds = Koha::Holds->search( { borrowernumber => $patron->{borrowernumber} } ); +is( $holds->forced_hold_level, 'item_group', "Item group level hold forces item group level holds" ); + $hold->delete(); # Test multi-hold via AddReserve -- 2.30.2