From 4b848f76169dfba3abe9ea0051cae0bb0348a4a6 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 7 Mar 2024 10:09:13 +0000 Subject: [PATCH] Bug 36268: Add a mock for ReplyToDefault Test plan: Without this patch, add email address in that pref. Run Letters.t. It fails. Now apply patch and run test again. Should pass. Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer (cherry picked from commit 5c71283c897de456db0824018fcb2b0f7931040d) Signed-off-by: Fridolin Somers --- t/db_dependent/Letters.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index 8295c63baa..4bc82f44fa 100755 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -247,6 +247,7 @@ is( $ISBN_letter->{name}, 'book', 'letter name for "ISBN" letter is book' ); # GetPreparedLetter t::lib::Mocks::mock_preference('OPACBaseURL', 'http://thisisatest.com'); t::lib::Mocks::mock_preference( 'SendAllEmailsTo', '' ); +t::lib::Mocks::mock_preference( 'ReplytoDefault', q{} ); my $sms_content = 'This is a SMS for an <>'; $dbh->do( q|INSERT INTO letter(branchcode,module,code,name,is_html,title,content,message_transport_type) VALUES (?,'my module','my code','my name',1,'my title',?,'sms')|, undef, $library->{branchcode}, $sms_content ); @@ -525,9 +526,9 @@ t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'library@domain.com' ); } qr|Fake send_or_die|, "SendAlerts is using the mocked send_or_die routine (orderacquisition)"; - is( $err, 1, "Successfully sent order." ); - is( $email_object->email->header('To'), 'testemail@mydomain.com', "mailto correct in sent order" ); - is( defined( $email_object->email->header('Reply-To') ), '', "No reply-to address is set" ); + is( $err, 1, "Successfully sent order." ); + is( $email_object->email->header('To'), 'testemail@mydomain.com', "mailto correct in sent order" ); + is( scalar $email_object->email->header('Reply-To'), undef, "No reply-to address is set" ); is( $email_object->email->body, 'my vendor|John Smith|Ordernumber ' @@ -764,8 +765,7 @@ subtest 'SendAlerts - claimissue' => sub { is( $err, 1, "Successfully sent claim" ); is( $email_object->email->header('To'), 'testemail@mydomain.com', "mailto correct in sent claim" ); - is( defined($email_object->email->header('Reply-To')), - '', "reply-to is not set" ); + is( scalar $email_object->email->header('Reply-To'), undef, "reply-to is not set" ); is( $email_object->email->body, "$serialids[0]|2013-01-01|Silence in the library|xxxx-yyyy", -- 2.39.5