From 2b4baae94a402d7be753645e8d83e21d617a462b 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. Signed-off-by: Marcel de Rooy Sponsored-by: Rijksmuseum, Netherlands Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- 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 402d78ac6c..325a5de370 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.39.5