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. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commit10b673ee1c) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> (cherry picked from commit305d081a4e) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
aa51b4c9a4
commit
6cc140d470
|
|
@ -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;
|
||||
|
|
@ -218,8 +220,14 @@ subtest 'Test handling of cancellation reason if passed' => sub {
|
|||
});
|
||||
my $reserve_id = $reserve->{reserve_id};
|
||||
my $count = Koha::Holds->search->count;
|
||||
CancelExpiredReserves("EXPIRED");
|
||||
is(Koha::Holds->search->count, $count-1, "Hold is cancelled when reason is passed");
|
||||
{
|
||||
# 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");
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue