From 2471dab71dff052b546f45690d8a3bea6f1f3811 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 11 Apr 2017 14:15:54 +0200 Subject: [PATCH] Bug 18413: Fix Letters.t (following bug 17866) SendAlert now needs a userenv to find branch email and the fallback of KohaAdminEmailAddress if the branch mail is not filled. Test plan: Run t/db_dependent/Letters.t Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- t/db_dependent/Letters.t | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index cb8e6cab81..e752a451fa 100644 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -423,6 +423,11 @@ $bookseller->contacts->next->email('testemail@mydomain.com')->store; # Ensure that the preference 'LetterLog' is set to logging t::lib::Mocks::mock_preference( 'LetterLog', 'on' ); +# SendAlerts needs branchemail or KohaAdminEmailAddress as sender +C4::Context->_new_userenv('DUMMY'); +C4::Context->set_userenv( 0, 0, 0, 'firstname', 'surname', $library->{branchcode}, 'My Library', 0, '', ''); +t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'library@domain.com' ); + { warning_is { $err = SendAlerts( 'orderacquisition', $basketno , 'TESTACQORDER' ) } -- 2.39.5