From 9105fd3f0ba6ea1ab65f66579445400b84dfbd0d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 14 Jun 2021 14:49:43 -0300 Subject: [PATCH] Bug 28503: (follow-up) Get rid of tests warnings Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Reserves.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index cd55a13266..9f408629d9 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -1313,11 +1313,15 @@ subtest 'ModReserveAffect logging' => sub { $hold = Koha::Holds->find($reserve_id); is( $hold->timestamp, $previous_timestamp, 'Make sure the previous timestamp has been used' ); + # Avoid warnings + my $reserve_mock = Test::MockModule->new('C4::Reserves'); + $reserve_mock->mock( '_koha_notify_reserve', undef ); + # Mark it waiting ModReserveAffect( $item->itemnumber, $patron->borrowernumber ); - $hold = Koha::Holds->find($reserve_id); - is( $hold->found, 'W', 'Hold has been set waiting' ); + $hold->discard_changes; + ok( $hold->is_waiting, 'Hold has been set waiting' ); isnt( $hold->timestamp, $previous_timestamp, 'The timestamp has been modified' ); my $log = Koha::ActionLogs->search({ module => 'HOLDS', action => 'MODIFY', object => $hold->reserve_id })->next; -- 2.32.0