Bugzilla – Attachment 155268 Details for
Bug 34666
_Findgroupreserve is not returning title level matches from the queue for holds with no item group
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34666: Add a second unit test for item level
Bug-34666-Add-a-second-unit-test-for-item-level.patch (text/plain), 2.48 KB, created by
Marcel de Rooy
on 2023-09-06 12:09:00 UTC
(
hide
)
Description:
Bug 34666: Add a second unit test for item level
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-09-06 12:09:00 UTC
Size:
2.48 KB
patch
obsolete
>From 1fc653a9d366b6d3837b4fbbe0d1fc9befb1f3b6 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 30 Aug 2023 18:54:15 +0000 >Subject: [PATCH] Bug 34666: Add a second unit test for item level >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Reserves.t | 21 +++++++++++++++++++-- > 1 file changed, 19 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index c31a909fc2..5280f68602 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -1776,12 +1776,13 @@ subtest 'DefaultHoldExpiration tests' => sub { > }; > > subtest '_Findgroupreserves' => sub { >- plan tests => 1; >+ plan tests => 4; > $schema->storage->txn_begin; > > my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); > my $patron_2 = $builder->build_object( { class => 'Koha::Patrons' } ); > my $item = $builder->build_sample_item(); >+ my $item_2 = $builder->build_sample_item( { biblionumber => $item->biblionumber } ); > > t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 ); > my $reserve_id_1 = AddReserve( >@@ -1810,6 +1811,22 @@ subtest '_Findgroupreserves' => sub { > > # When the hold is title level and in the hold fill targets we expect this to be the only hold returned > my @reserves = C4::Reserves::_Findgroupreserve( $item->biblionumber, $item->id, 0, [] ); >- is( scalar @reserves, 1, "We should only get the hold that is in the map" ); >+ is( scalar @reserves, 1, "We should only get the hold that is in the map" ); >+ is( $reserves[0]->{reserve_id}, $reserve_id_1, "We got the expected reserve" ); >+ >+ C4::HoldsQueue::AddToHoldTargetMap( >+ { >+ $item_2->id => { >+ borrowernumber => $patron_2->id, biblionumber => $item->biblionumber, >+ holdingbranch => $item->holdingbranch, item_level => 1, reserve_id => $reserve_id_2 >+ } >+ } >+ ); >+ >+ # When the hold is title level and in the hold fill targets we expect this to be the only hold returned >+ @reserves = C4::Reserves::_Findgroupreserve( $item->biblionumber, $item_2->id, 0, [] ); >+ is( scalar @reserves, 1, "We should only get the item level hold that is in the map" ); >+ is( $reserves[0]->{reserve_id}, $reserve_id_2, "We got the expected reserve" ); >+ > $schema->txn_rollback; > }; >-- >2.30.2
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 34666
:
154978
|
154979
|
154980
|
154981
|
154983
|
154984
|
154985
|
154986
|
155221
|
155266
|
155267
| 155268 |
155269
|
155270