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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2023-11-01 14:50:47 +00:00 committed by Tomas Cohen Arazi
parent 15f0dc2c2a
commit 0ea2a1c7be
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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' );