From 627fdea30e96f02bb4aef7cf2d876826257eeff2 Mon Sep 17 00:00:00 2001 From: Martin Renvoize 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 --- 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