From 503b67cbdde7b25933ff8a560127811f7dda82e6 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 12 Jul 2022 16:21:30 +0100 Subject: [PATCH] Bug 31086: (QA follow-up) Fix failing tests This test was missed first time around, branchcode needed adding to all the calls to AddReserve. Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit bdddc7ee0a3a0ed2ec1c5996ab5be587c1e395df) Signed-off-by: Lucas Gass (cherry picked from commit 51f33cbc209b37b20fb8ae8e9f1003940e672084) Signed-off-by: Arthur Suzuki --- t/db_dependent/Koha/Holds.t | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/t/db_dependent/Koha/Holds.t b/t/db_dependent/Koha/Holds.t index a2fbb88541..43fcd69aa1 100755 --- a/t/db_dependent/Koha/Holds.t +++ b/t/db_dependent/Koha/Holds.t @@ -431,10 +431,13 @@ subtest 'get_items_that_can_fill' => sub { my $patron_2 = $builder->build_object( { class => 'Koha::Patrons' } ); my $patron_3 = $builder->build_object( { class => 'Koha::Patrons' } ); + my $library_1 = $builder->build_object( { class => 'Koha::Libraries' } ); + t::lib::Mocks::mock_userenv( { patron => $patron_1 } ); my $reserve_id_1 = C4::Reserves::AddReserve( { + branchcode => $library_1->branchcode, borrowernumber => $patron_1->borrowernumber, biblionumber => $biblio->biblionumber, priority => 1, @@ -448,6 +451,7 @@ subtest 'get_items_that_can_fill' => sub { my $reserve_id_2 = C4::Reserves::AddReserve( { + branchcode => $library_1->branchcode, borrowernumber => $patron_2->borrowernumber, biblionumber => $biblio->biblionumber, priority => 2, @@ -457,6 +461,7 @@ subtest 'get_items_that_can_fill' => sub { my $waiting_reserve_id = C4::Reserves::AddReserve( { + branchcode => $library_1->branchcode, borrowernumber => $patron_2->borrowernumber, biblionumber => $biblio->biblionumber, priority => 0, @@ -465,6 +470,16 @@ subtest 'get_items_that_can_fill' => sub { } ); + my $notforloan_reserve_id = C4::Reserves::AddReserve( + { + branchcode => $library_1->branchcode, + borrowernumber => $patron_2->borrowernumber, + biblionumber => $biblio->biblionumber, + priority => 0, + itemnumber => $notforloan->itemnumber, + } + ); + # item 3 is on loan AddIssue( $patron_3->unblessed, $item_3->barcode ); -- 2.20.1