Bugzilla – Attachment 185706 Details for
Bug 37651
biblio->current_holds and item->current_holds do not respect ConfirmFutureHolds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37651: (QA follow-up) Fix current_holds tests in Reserves.t
Bug-37651-QA-follow-up-Fix-currentholds-tests-in-R.patch (text/plain), 3.08 KB, created by
Marcel de Rooy
on 2025-08-22 06:54:44 UTC
(
hide
)
Description:
Bug 37651: (QA follow-up) Fix current_holds tests in Reserves.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-08-22 06:54:44 UTC
Size:
3.08 KB
patch
obsolete
>From 17dceb9ea1094077f28c3b594ff6bfcefaa51246 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 22 Aug 2025 08:53:00 +0200 >Subject: [PATCH] Bug 37651: (QA follow-up) Fix current_holds tests in > Reserves.t >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run prove t/db_dependent/Reserves.t >--- > t/db_dependent/Reserves.t | 25 ++++++++++--------------- > 1 file changed, 10 insertions(+), 15 deletions(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index b7b1d26dc4..8c533d4b3c 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -448,8 +448,7 @@ is( > my $letter = ReserveSlip( { branchcode => $branch_1, reserve_id => $reserve_id } ); > ok( defined($letter), 'can successfully generate hold slip (bug 10949)' ); > >-# Tests for bug 9788: Does Koha::Item->current_holds return a future wait? >-# 9788a: current_holds does not return future next available hold >+# Does Koha::Biblio->current_holds respect ConfirmFutureHolds for a next available hold? > $dbh->do( "DELETE FROM reserves WHERE biblionumber=?", undef, ($bibnum) ); > t::lib::Mocks::mock_preference( 'ConfirmFutureHolds', 2 ); > t::lib::Mocks::mock_preference( 'AllowHoldDateInFuture', 1 ); >@@ -465,12 +464,10 @@ AddReserve( > } > ); > >-$holds = $item->current_holds; >-my $dtf = Koha::Database->new->schema->storage->datetime_parser; >-my $future_holds = $holds->search( { reservedate => { '>' => $dtf->format_date(dt_from_string) } } ); >-is( $future_holds->count, 0, 'current_holds does not return a future next available hold' ); >+$holds = Koha::Biblios->find($bibnum)->current_holds; >+is( $holds->count, 1, 'current_holds returns a future next available hold' ); > >-# 9788b: current_holds does not return future item level hold >+# Does Koha::Item->current_holds respect ConfirmFutureHolds for a item level hold? > $dbh->do( "DELETE FROM reserves WHERE biblionumber=?", undef, ($bibnum) ); > AddReserve( > { >@@ -482,16 +479,14 @@ AddReserve( > itemnumber => $item->itemnumber, > } > ); #item level hold >-$future_holds = $holds->search( { reservedate => { '>' => $dtf->format_date(dt_from_string) } } ); >-is( $future_holds->count, 0, 'current_holds does not return a future item level hold' ); >+$holds = $item->current_holds; >+is( $holds->count, 1, 'current_holds returns a future item level hold' ); > >-# 9788c: current_holds returns future wait (confirmed future hold) >+# Does $item->current_holds return a future wait (confirmed future hold)? >+t::lib::Mocks::mock_preference( 'ConfirmFutureHolds', 1 ); > ModReserveAffect( $item->itemnumber, $requesters{$branch_1}->borrowernumber, 0 ); #confirm hold >-$future_holds = $holds->search( { reservedate => { '>' => $dtf->format_date(dt_from_string) } } ); >-is( $future_holds->count, 1, 'current_holds returns a future wait (confirmed future hold)' ); >- >-# End of tests for bug 9788 >- >+$holds = $item->current_holds; >+is( $holds->count, 1, 'current_holds returns a future wait (confirmed future hold)' ); > $dbh->do( "DELETE FROM reserves WHERE biblionumber=?", undef, ($bibnum) ); > > # Tests for CalculatePriority (bug 8918) >-- >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 37651
:
171247
|
171248
|
171249
|
171250
|
176654
|
176655
|
176656
|
176808
|
176809
|
176810
|
176811
|
177372
|
178325
|
178326
|
178327
|
178328
|
178329
|
184438
|
184439
|
184440
|
184441
|
184442
|
184443
|
184444
|
185365
|
185366
|
185367
|
185368
|
185369
|
185370
|
185371
| 185706