Bugzilla – Attachment 181369 Details for
Bug 38650
We should only fill title level or specific item holds when a patron checks out an item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38650: Unit tests
Bug-38650-Unit-tests.patch (text/plain), 2.56 KB, created by
Andrew Fuerste-Henry
on 2025-04-23 12:40:43 UTC
(
hide
)
Description:
Bug 38650: Unit tests
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2025-04-23 12:40:43 UTC
Size:
2.56 KB
patch
obsolete
>From c370f14b3d9fcbd2924e43a8eed0fb3c544757b0 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 9 Dec 2024 20:22:49 +0000 >Subject: [PATCH] Bug 38650: Unit tests > >Signed-off-by: Stephanie Petruso <spetruso@aacpl.net> >--- > t/db_dependent/Reserves.t | 27 +++++++++++++++++++++++++-- > 1 file changed, 25 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 93ab654c18..98f3d8705b 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -1135,7 +1135,7 @@ subtest 'reserves.item_level_hold' => sub { > > subtest 'MoveReserve additional test' => sub { > >- plan tests => 4; >+ plan tests => 8; > > # Create the items and patrons we need > my $biblio = $builder->build_sample_biblio(); >@@ -1175,7 +1175,7 @@ subtest 'MoveReserve additional test' => sub { > ( $patron_1->borrowernumber, $biblio->biblionumber, $item_1->itemnumber, $item_1->homebranch, 0, $reserve_1 ) > ); > >- # The 2nd hold should be filed even if the item is preselected for the first hold >+ # The 2nd hold should be filled even if the item is preselected for the first hold > MoveReserve( $item_1->itemnumber, $patron_2->borrowernumber ); > is( $patron_2->holds->count, 0, "The 2nd patrons no longer has a hold" ); > is( >@@ -1183,6 +1183,29 @@ subtest 'MoveReserve additional test' => sub { > "The 2nd patrons hold was filled and moved to old holds" > ); > >+ my $reserve_3 = AddReserve( >+ { >+ branchcode => $item_2->homebranch, >+ borrowernumber => $patron_2->borrowernumber, >+ biblionumber => $biblio->biblionumber, >+ priority => 1, >+ itemnumber => $item_2->itemnumber, >+ } >+ ); >+ >+ # The 3rd hold should not be filled as it is an item level hold on a different item >+ MoveReserve( $item_1->itemnumber, $patron_2->borrowernumber ); >+ is( $patron_2->holds->count, 1, "The 2nd patron still has a hold" ); >+ is( $patron_2->old_holds->count, 1, "The 2nd patron has only 1 old holds" ); >+ >+ my $hold_3 = Koha::Holds->find($reserve_3); >+ $hold_3->item_level_hold(0)->store(); >+ >+ # The 3rd hold should now be filled as it is a title level hold, even though associated with a different item >+ MoveReserve( $item_1->itemnumber, $patron_2->borrowernumber ); >+ is( $patron_2->holds->count, 0, "The 2nd patron no longer has a hold" ); >+ is( $patron_2->old_holds->count(), 2, "The 2nd patron's hold was filled and moved to old holds" ); >+ > }; > > subtest 'RevertWaitingStatus' => sub { >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38650
:
175335
|
175336
|
181143
|
181144
|
181369
|
181370
|
182017
|
182018