From ff3ec00ececc92fcdb83c523bd01e07b6963d8ed 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) Content-Type: text/plain; charset=utf-8 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 --- 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 cb8e6ca..e752a45 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.1.4