From 67eedb6c556061b00c56f6a31c849afce06ae603 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 8 Jul 2022 09:05:26 +0200 Subject: [PATCH] Bug 28787: Mock send_or_die To make the tests pass even if no SMTP server is defined. --- t/db_dependent/api/v1/two_factor_auth.t | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/t/db_dependent/api/v1/two_factor_auth.t b/t/db_dependent/api/v1/two_factor_auth.t index 402d78ac6c1..325a5de3708 100755 --- a/t/db_dependent/api/v1/two_factor_auth.t +++ b/t/db_dependent/api/v1/two_factor_auth.t @@ -36,6 +36,11 @@ t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); my $remote_address = '127.0.0.1'; my $t = Test::Mojo->new('Koha::REST::V1'); +my $mocked_koha_email = Test::MockModule->new('Koha::Email'); +$mocked_koha_email->mock( 'send_or_die', sub { + return 1; +}); + subtest 'send_otp_token' => sub { plan tests => 9; -- 2.25.1