mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
Added test cases for mb_send_mail()
This commit is contained in:
parent
827974bc94
commit
5d547d1f0c
37
ext/mbstring/tests/mb_send_mail01.phpt
Normal file
37
ext/mbstring/tests/mb_send_mail01.phpt
Normal file
@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
mb_send_mail() test 1 (lang=neutral)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (@mb_send_mail() === false || !mb_language("neutral")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=cat
|
||||
--FILE--
|
||||
<?php
|
||||
$to = 'example@example.com';
|
||||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
|
||||
/* neutral (UTF-8) */
|
||||
if (mb_language("neutral")) {
|
||||
mb_send_mail($to, "test ".mb_language(), "test");
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=%s
|
||||
Content-Transfer-Encoding: %s
|
||||
|
||||
test
|
||||
To: example@example.com
|
||||
Subject: test neutral
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: BASE64
|
||||
|
||||
test
|
37
ext/mbstring/tests/mb_send_mail02.phpt
Normal file
37
ext/mbstring/tests/mb_send_mail02.phpt
Normal file
@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
mb_send_mail() test 2 (lang=Japanese)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (@mb_send_mail() === false || !mb_language("japanese")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=cat
|
||||
--FILE--
|
||||
<?php
|
||||
$to = 'example@example.com';
|
||||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
|
||||
/* Japanese (EUC-JP) */
|
||||
if (mb_language("japanese")) {
|
||||
mb_send_mail($to, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ".mb_language(), "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=%s
|
||||
Content-Transfer-Encoding: %s
|
||||
|
||||
test
|
||||
To: example@example.com
|
||||
Subject: =?ISO-2022-JP?B?GyRCJUYlOSVIGyhCIEphcGFuZXNl?=
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=ISO-2022-JP
|
||||
Content-Transfer-Encoding: 7bit
|
||||
|
||||
テスト
|
37
ext/mbstring/tests/mb_send_mail03.phpt
Normal file
37
ext/mbstring/tests/mb_send_mail03.phpt
Normal file
@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
mb_send_mail() test 3 (lang=English)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (@mb_send_mail() === false || !mb_language("german")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=cat
|
||||
--FILE--
|
||||
<?php
|
||||
$to = 'example@example.com';
|
||||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
|
||||
/* English (iso-8859-1) */
|
||||
if (mb_language("english")) {
|
||||
mb_send_mail($to, "test ".mb_language(), "test");
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=%s
|
||||
Content-Transfer-Encoding: %s
|
||||
|
||||
test
|
||||
To: example@example.com
|
||||
Subject: test English
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=%s-8859-1
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
test
|
37
ext/mbstring/tests/mb_send_mail04.phpt
Normal file
37
ext/mbstring/tests/mb_send_mail04.phpt
Normal file
@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
mb_send_mail() test 4 (lang=German)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (@mb_send_mail() === false || !mb_language("german")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=cat
|
||||
--FILE--
|
||||
<?php
|
||||
$to = 'example@example.com';
|
||||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
|
||||
/* German (iso-8859-15) */
|
||||
if (mb_language("german")) {
|
||||
mb_send_mail($to, "Pr"."\xfc"."fung ".mb_language(), "Pr"."\xfc"."fung");
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=%s
|
||||
Content-Transfer-Encoding: %s
|
||||
|
||||
test
|
||||
To: example@example.com
|
||||
Subject: =?ISO-8859-15?Q?Pr=FCfung=20German?=
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=%s-8859-15
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Prüfung
|
Loading…
Reference in New Issue
Block a user