Bugzilla – Attachment 154978 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: Unit test
Bug-34666-Unit-test.patch (text/plain), 2.63 KB, created by
Nick Clemens (kidclamp)
on 2023-08-30 19:04:44 UTC
(
hide
)
Description:
Bug 34666: Unit test
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-08-30 19:04:44 UTC
Size:
2.63 KB
patch
obsolete
>From 86f68397d2ff1f5da57fc8cfdee5775463c04c5a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 30 Aug 2023 18:29:27 +0000 >Subject: [PATCH] Bug 34666: Unit test > >--- > t/db_dependent/Reserves.t | 42 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 41 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 7e2d83e50e..c31a909fc2 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 77; >+use Test::More tests => 78; > use Test::MockModule; > use Test::Warn; > >@@ -30,6 +30,7 @@ use DateTime::Duration; > use C4::Circulation qw( AddReturn AddIssue ); > use C4::Items; > use C4::Biblio qw( GetMarcFromKohaField ModBiblio ); >+use C4::HoldsQueue; > use C4::Members; > use C4::Reserves qw( AddReserve AlterPriority CheckReserves GetReservesControlBranch ModReserve ModReserveAffect ReserveSlip CalculatePriority CanReserveBeCanceledFromOpac CanBookBeReserved IsAvailableForItemLevelRequest MoveReserve ChargeReserveFee RevertWaitingStatus CanItemBeReserved MergeHolds ); > use Koha::ActionLogs; >@@ -1773,3 +1774,42 @@ subtest 'DefaultHoldExpiration tests' => sub { > > $schema->txn_rollback; > }; >+ >+subtest '_Findgroupreserves' => sub { >+ plan tests => 1; >+ $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(); >+ >+ t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 0 ); >+ my $reserve_id_1 = AddReserve( >+ { >+ branchcode => $item->homebranch, >+ borrowernumber => $patron_1->id, >+ biblionumber => $item->biblionumber, >+ } >+ ); >+ my $reserve_id_2 = AddReserve( >+ { >+ branchcode => $item->homebranch, >+ borrowernumber => $patron_2->id, >+ biblionumber => $item->biblionumber, >+ } >+ ); >+ >+ C4::HoldsQueue::AddToHoldTargetMap( >+ { >+ $item->id => { >+ borrowernumber => $patron_1->id, biblionumber => $item->biblionumber, >+ holdingbranch => $item->holdingbranch, item_level => 0, reserve_id => $reserve_id_1 >+ } >+ } >+ ); >+ >+ # 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" ); >+ $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