From 50fbf7097e7b84eb4d95c1535a45a82d2ad520d9 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 1 Nov 2023 14:50:47 +0000 Subject: [PATCH] Bug 35215: Add few assumptions in Suggestions.t around emailing Test plan: Without this patch, set pref ReplytoDefault or EmailAddressForSuggestions. Run t/db_dependent/Suggestions.t (FAIL) Fill branch email and reply for CPL branch. Run t/db_dependent/Suggestions.t (FAIL: more errors) Apply patch. Run t/db_dependent/Suggestions.t (PASS) Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 0ea2a1c7be73995ca4b26c67f049912259c457a6) Signed-off-by: Fridolin Somers --- t/db_dependent/Suggestions.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Suggestions.t b/t/db_dependent/Suggestions.t index 5a6f7a2bbe..abcbd626c5 100755 --- a/t/db_dependent/Suggestions.t +++ b/t/db_dependent/Suggestions.t @@ -473,8 +473,10 @@ subtest 'EmailPurchaseSuggestions' => sub { 'New suggestion does not send an email when EmailPurchaseSuggestions disabled' ); # EmailPurchaseSuggestions set to BranchEmailAddress - t::lib::Mocks::mock_preference( "EmailPurchaseSuggestions", - "BranchEmailAddress" ); + t::lib::Mocks::mock_preference( "EmailPurchaseSuggestions", "BranchEmailAddress" ); + t::lib::Mocks::mock_preference( "ReplytoDefault", "" ); + t::lib::Mocks::mock_preference( "EmailAddressForSuggestions", "" ); + Koha::Libraries->find('CPL')->update( { branchemail => '', branchreplyto => '' } ); Koha::Suggestion->new($my_suggestion)->store; t::lib::Mocks::mock_preference( "ReplytoDefault", 'library@b.c' ); -- 2.20.1