Bugzilla – Attachment 108529 Details for
Bug 22343
Add configuration options for SMTP servers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22343: Explicit testing of charset
Bug-22343-Explicit-testing-of-charset.patch (text/plain), 2.39 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-08-18 17:06:34 UTC
(
hide
)
Description:
Bug 22343: Explicit testing of charset
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-08-18 17:06:34 UTC
Size:
2.39 KB
patch
obsolete
>From 4f5c6d95c23f753cc1a0dae54d857451e2a30b6a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 18 Aug 2020 14:02:49 -0300 >Subject: [PATCH] Bug 22343: Explicit testing of charset > >This patch tests content type and charset separatedly. This is done to >avoid assuming the underlying library will always return the data >structured in the same way, which is not to be guaranteed on the spec. > >This way the tests don't fail if things are ordered in another way, or >if some more attributes are passed in the content type header >(respecting the RFC for the format). > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/Koha/Email.t | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/t/Koha/Email.t b/t/Koha/Email.t >index b76959d99e..54b5cd126d 100644 >--- a/t/Koha/Email.t >+++ b/t/Koha/Email.t >@@ -25,7 +25,7 @@ use_ok('Koha::Email'); > > subtest 'create() tests' => sub { > >- plan tests => 21; >+ plan tests => 23; > > t::lib::Mocks::mock_preference( 'SendAllEmailsTo', undef ); > >@@ -56,7 +56,8 @@ subtest 'create() tests' => sub { > is( $email->email->header('Subject'), 'Some subject', 'Value set correctly' ); > is( $email->email->header('X-Mailer'), 'Koha', 'Value set correctly' ); > is( $email->email->body, $html_body, "Body set correctly" ); >- is( $email->email->content_type, 'text/html; charset="utf-8"', "Content type set correctly"); >+ like( $email->email->content_type, qr|text/html|, "Content type set correctly"); >+ like( $email->email->content_type, qr|charset="utf-8"|, "Charset set correctly"); > like( $email->email->header('Message-ID'), qr/\<.*@.*\>/, 'Value set correctly' ); > > t::lib::Mocks::mock_preference( 'SendAllEmailsTo', 'catchall@example.com' ); >@@ -81,6 +82,7 @@ subtest 'create() tests' => sub { > is( $email->email->header('ReplyTo'), 'replytodefault@example.com', 'ReplytoDefault picked when replyto not passed' ); > is( $email->email->header('Sender'), 'returnpathdefault@example.com', 'ReturnpathDefault picked when sender not passed' ); > is( $email->email->body, $text_body, "Body set correctly" ); >- is( $email->email->content_type, 'text/plain; charset="utf-8"; format="flowed"', "Content type set correctly"); >+ like( $email->email->content_type, qr|text/plain|, "Content type set correctly"); >+ like( $email->email->content_type, qr|charset="utf-8"|, "Charset set correctly"); > }; > >-- >2.28.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22343
:
107598
|
107599
|
107600
|
107601
|
107602
|
107603
|
107604
|
107605
|
107987
|
107988
|
107989
|
107990
|
107991
|
107992
|
107993
|
107994
|
107995
|
107996
|
107997
|
107998
|
107999
|
108009
|
108107
|
108108
|
108109
|
108110
|
108111
|
108112
|
108113
|
108114
|
108115
|
108116
|
108117
|
108118
|
108119
|
108131
|
108132
|
108133
|
108134
|
108135
|
108136
|
108137
|
108138
|
108139
|
108140
|
108141
|
108142
|
108143
|
108529
|
108537
|
108538
|
108539
|
108540
|
108541
|
108542
|
108543
|
108544
|
108545
|
108546
|
108547
|
108548
|
108549
|
108609
|
108638
|
108642
|
108643
|
108644
|
108645
|
108646
|
108647
|
108648
|
108649
|
108650
|
108651
|
108652
|
108653
|
108654
|
108655
|
108656
|
108715
|
108716
|
109003
|
109004
|
109005
|
109006
|
109007
|
109008
|
109009
|
109010
|
109011
|
109012
|
109013
|
109014
|
109015
|
109016
|
109017
|
109018
|
109155
|
109156
|
109157
|
109158
|
109159
|
109160
|
109161
|
109162
|
109163
|
109164
|
109165
|
109166
|
109167
|
109168
|
109169
|
109170
|
109601
|
109602
|
109603
|
109604
|
109605
|
109606
|
109607
|
109608
|
109609
|
109610
|
109611
|
109612
|
109613
|
109614
|
109615
|
109616
|
109723
|
109724
|
109725
|
109726
|
109727
|
109728
|
109729
|
109730
|
109731
|
109732
|
109733
|
109734
|
109735
|
109736
|
109737
|
109738
|
109739
|
109740
|
109787
|
109788
|
111048
|
111087
|
111088
|
111089
|
111090
|
111154
|
111165
|
111166
|
111175
|
111176
|
111213
|
111215
|
111216
|
111442
|
111482
|
113240
|
113827
|
113847