Bugzilla – Attachment 190676 Details for
Bug 40435
Allow CanBookBeRenewed to consider future holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40435: (follow-up) Fix DateTime mutation in test
627fdea.patch (text/plain), 1.51 KB, created by
Martin Renvoize (ashimema)
on 2025-12-22 14:07:41 UTC
(
hide
)
Description:
Bug 40435: (follow-up) Fix DateTime mutation in test
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-12-22 14:07:41 UTC
Size:
1.51 KB
patch
obsolete
>From 627fdea30e96f02bb4aef7cf2d876826257eeff2 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Mon, 22 Dec 2025 13:55:21 +0000 >Subject: [PATCH] Bug 40435: (follow-up) Fix DateTime mutation in test > >The test had a bug where $future_date was being mutated by the >add() method on line 1975, causing line 1982 to use 4 days >instead of 2 days. This meant the test wasn't properly verifying >that FutureHoldsBlockRenewals=0 prevents blocking for holds >within the ConfirmFutureHolds window. > >Test plan: >1. Run: prove t/db_dependent/Circulation.t :: "CanBookBeRenewed | future holds" >2. Verify all tests pass >3. Confirm the test now properly validates the intended behavior > >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > t/db_dependent/Circulation.t | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index c641ca08343..ab338dfb080 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -1979,7 +1979,7 @@ subtest "CanBookBeRenewed | future holds" => sub { > > # Skip future holds for renewals > t::lib::Mocks::mock_preference( 'FutureHoldsBlockRenewals', 0 ); >- $hold->reservedate($future_date)->store; >+ $hold->reservedate( DateTime->today->add( days => 2 ) )->store; > ( $renewok, $error ) = CanBookBeRenewed( $patron1, $issue, 0 ); > is( $renewok, 1, 'Can be renewed when future holds are skipped' ); > is( $error, undef, 'No error message 2' ); >-- >2.52.0 >
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 40435
:
190449
|
190450
|
190451
|
190452
|
190453
|
190520
|
190521
|
190522
|
190523
|
190524
|
190671
|
190672
|
190673
|
190674
|
190675
| 190676 |
190677