summaryrefslogtreecommitdiff
path: root/test/it_mail.t
diff options
context:
space:
mode:
Diffstat (limited to 'test/it_mail.t')
-rwxr-xr-xtest/it_mail.t22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/it_mail.t b/test/it_mail.t
index 6aefd84..41a92b1 100755
--- a/test/it_mail.t
+++ b/test/it_mail.t
@@ -7,19 +7,19 @@ $mail = new it_mail();
# header_escape tests
#
is(
- $mail->addrlist_escape('éxample@example.com', true),
+ $mail->addrlist_encode('éxample@example.com', true),
'éxample@example.com',
"Don't escape plain email addresses in email headers"
);
is(
- $mail->header_escape('éxample@example.com'),
+ $mail->header_encode('éxample@example.com'),
'=?utf-8?Q?=C3=A9xample@example.com?=',
"Escape plain email in non-email headers"
);
is(
- $mail->header_escape('search.ch e-mail code d\'accès'),
+ $mail->header_encode('search.ch e-mail code d\'accès'),
version_compare(PHP_VERSION, '7.2.11') < 0
? '=?utf-8?B?c2VhcmNoLmNoIGUtbWFpbCBjb2RlIGQnYWNjw6hz?='
: '=?utf-8?Q?search.ch=20e-mail=20code=20d\'acc=C3=A8s?=',
@@ -27,37 +27,37 @@ is(
);
is(
- $mail->addrlist_escape('Èxample User <èxample@example.com>', true),
+ $mail->addrlist_encode('Èxample User <èxample@example.com>', true),
'=?utf-8?Q?=C3=88xample=20User?= <èxample@example.com>',
"Escape name but not email in email headers"
);
is(
- $mail->addrlist_escape('Example User <example@example.com>', true),
+ $mail->addrlist_encode('Example User <example@example.com>', true),
'Example User <example@example.com>',
"Don't escape characters that don't need escaping"
);
is(
- $mail->addrlist_escape('example@example.com, éxample@example.com, Sömeone Ëlse <sömeone@example.com>', true),
+ $mail->addrlist_encode('example@example.com, éxample@example.com, Sömeone Ëlse <sömeone@example.com>', true),
'example@example.com, éxample@example.com, =?utf-8?Q?S=C3=B6meone=20=C3=8Blse?= <sömeone@example.com>',
"Don't escape email addresses but escape realnames"
);
is(
- $mail->addrlist_escape('"Alfred E. Neuman" <neuman@example.com>', true),
+ $mail->addrlist_encode('"Alfred E. Neuman" <neuman@example.com>', true),
'"Alfred E. Neuman" <neuman@example.com>',
"Don't remove quoting characters from realname"
);
is(
- $mail->addrlist_escape('"Schmitt, Sören" <schmitt@example.com>', true),
+ $mail->addrlist_encode('"Schmitt, Sören" <schmitt@example.com>', true),
'=?utf-8?Q?"Schmitt,=20S=C3=B6ren"?= <schmitt@example.com>',
"Don't remove quoting characters from realname when it contains a quotable character"
);
is(
- $mail->addrlist_escape('"Alfred E. Neuman" <t€st@sör.ch>', true),
+ $mail->addrlist_encode('"Alfred E. Neuman" <t€st@sör.ch>', true),
'"Alfred E. Neuman" <t€st@xn--sr-fka.ch>',
"Convert domain in email to idn version"
);
@@ -119,5 +119,5 @@ is(it_mail::email_split('test@sör.ch'), ['test', 'sör.ch'], 'email_split test@
is(it_mail::email_split('"test@local.ch".foo.bar@search.ch'), ['"test@local.ch".foo.bar', 'search.ch'], 'email_split "test@local.ch".foo.bar@search.ch');
is(it_mail::email_split('aneuman'), ['aneuman', ''], 'email_split aneuman');
-is(it_mail::email_escape('test@sör.ch'), 'test@xn--sr-fka.ch', 'idn encode domain sör.ch');
-is(it_mail::email_escape('أحمد@مثال.آزمایشی'), 'أحمد@xn--mgbh0fb.xn--hgbk6aj7f53bba', 'idn encode domain ﻢﺛﺎﻟ.ﺁﺰﻣﺎﯿﺸﯾ');
+is(it_mail::email_encode('test@sör.ch'), 'test@xn--sr-fka.ch', 'idn encode domain sör.ch');
+is(it_mail::email_encode('أحمد@مثال.آزمایشی'), 'أحمد@xn--mgbh0fb.xn--hgbk6aj7f53bba', 'idn encode domain ﻢﺛﺎﻟ.ﺁﺰﻣﺎﯿﺸﯾ');