Bugzilla – Attachment 184086 Details for
Bug 40385
Reserves/CancelExpiredReserves.t generates a warning
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40385: Remove warning from Reserves/CancelExpiredReserves.t
Bug-40385-Remove-warning-from-ReservesCancelExpire.patch (text/plain), 1.73 KB, created by
Jonathan Druart
on 2025-07-15 12:36:52 UTC
(
hide
)
Description:
Bug 40385: Remove warning from Reserves/CancelExpiredReserves.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-07-15 12:36:52 UTC
Size:
1.73 KB
patch
obsolete
>From 5293f27b064461c24bd9e8558a79f3ce5e84d764 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 15 Jul 2025 14:35:40 +0200 >Subject: [PATCH] Bug 40385: Remove warning from > Reserves/CancelExpiredReserves.t > >t/db_dependent/Reserves/CancelExpiredReserves.t .. 3/4 No reserves HOLD_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 602. >--- > t/db_dependent/Reserves/CancelExpiredReserves.t | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Reserves/CancelExpiredReserves.t b/t/db_dependent/Reserves/CancelExpiredReserves.t >index b9713ebd145..2cc84788eda 100755 >--- a/t/db_dependent/Reserves/CancelExpiredReserves.t >+++ b/t/db_dependent/Reserves/CancelExpiredReserves.t >@@ -1,7 +1,9 @@ > #!/usr/bin/perl > > use Modern::Perl; >-use Test::More tests => 4; >+use Test::More tests => 5; >+use Test::NoWarnings; >+use Test::MockModule; > > use t::lib::Mocks; > use t::lib::TestBuilder; >@@ -240,7 +242,13 @@ subtest 'Test handling of cancellation reason if passed' => sub { > ); > my $reserve_id = $reserve->{reserve_id}; > my $count = Koha::Holds->search->count; >- CancelExpiredReserves("EXPIRED"); >+ { >+ # Prevent warning 'No reserves HOLD_CANCELLATION letter transported by email' >+ my $mock_letters = Test::MockModule->new('C4::Letters'); >+ $mock_letters->mock( 'GetPreparedLetter', sub { return } ); >+ >+ CancelExpiredReserves("EXPIRED"); >+ } > is( Koha::Holds->search->count, $count - 1, "Hold is cancelled when reason is passed" ); > my $old_reserve = Koha::Old::Holds->find($reserve_id); > is( $old_reserve->cancellation_reason, 'EXPIRED', "Hold cancellation_reason was set correctly" ); >-- >2.34.1
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 40385
: 184086