Added test cases for mb_send_mail()

This commit is contained in:
Moriyoshi Koizumi 2002-11-12 20:04:58 +00:00
parent 827974bc94
commit 5d547d1f0c
4 changed files with 148 additions and 0 deletions

View 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

View 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
テスト

View 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

View 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