mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Run mb_send_mail tests on Windows, too
We use the run-tests.php `{MAIL}` abstraction instead of `cat`. Closes GH-7908.
This commit is contained in:
parent
c6bb747115
commit
51eec5086f
8 changed files with 56 additions and 32 deletions
|
@ -4,15 +4,12 @@ Bug #52681 (mb_send_mail() appends an extra MIME-Version header)
|
|||
mbstring
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. Not valid for Windows');
|
||||
}
|
||||
if (!function_exists("mb_send_mail") || !mb_language("neutral")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=/bin/cat
|
||||
sendmail_path={MAIL:{PWD}/bug52681.eml}
|
||||
mail.add_x_header=off
|
||||
--FILE--
|
||||
<?php
|
||||
|
@ -20,6 +17,12 @@ $to = 'example@example.com';
|
|||
$headers = 'MIME-Version: 2.0';
|
||||
|
||||
mb_send_mail($to, mb_language(), "test", $headers);
|
||||
|
||||
readfile(__DIR__ . "/bug52681.eml");
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . "/bug52681.eml");
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
|
|
|
@ -4,15 +4,12 @@ mb_send_mail() test 1 (lang=neutral)
|
|||
mbstring
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. Not valid for Windows');
|
||||
}
|
||||
if (!function_exists("mb_send_mail") || !mb_language("neutral")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=/bin/cat
|
||||
sendmail_path={MAIL:{PWD}/mb_send_mail01.eml}
|
||||
mail.add_x_header=off
|
||||
--FILE--
|
||||
<?php
|
||||
|
@ -20,13 +17,19 @@ $to = 'example@example.com';
|
|||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
readfile(__DIR__ . "/mb_send_mail01.eml");
|
||||
|
||||
/* neutral (UTF-8) */
|
||||
if (mb_language("neutral")) {
|
||||
mb_internal_encoding("UTF-8");
|
||||
mb_send_mail($to, "test ".mb_language(), "test");
|
||||
readfile(__DIR__ . "/mb_send_mail01.eml");
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . "/mb_send_mail01.eml");
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
|
|
|
@ -4,15 +4,12 @@ mb_send_mail() test 2 (lang=Japanese)
|
|||
mbstring
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. Not valid for Windows');
|
||||
}
|
||||
if (!function_exists("mb_send_mail") || !mb_language("japanese")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=/bin/cat
|
||||
sendmail_path={MAIL:{PWD}/mb_send_mail02.eml}
|
||||
mail.add_x_header=off
|
||||
--FILE--
|
||||
<?php
|
||||
|
@ -20,13 +17,19 @@ $to = 'example@example.com';
|
|||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
readfile(__DIR__ . "/mb_send_mail02.eml");
|
||||
|
||||
/* Japanese (EUC-JP) */
|
||||
if (mb_language("japanese")) {
|
||||
mb_internal_encoding('EUC-JP');
|
||||
mb_send_mail($to, "テスト ".mb_language(), "テスト");
|
||||
readfile(__DIR__ . "/mb_send_mail02.eml");
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . "/mb_send_mail02.eml");
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
|
|
|
@ -4,15 +4,12 @@ mb_send_mail() test 3 (lang=English)
|
|||
mbstring
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. Not valid for Windows');
|
||||
}
|
||||
if (!function_exists("mb_send_mail") || !mb_language("english")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=/bin/cat
|
||||
sendmail_path={MAIL:{PWD}/mb_send_mail03.eml}
|
||||
mail.add_x_header=off
|
||||
--FILE--
|
||||
<?php
|
||||
|
@ -20,13 +17,19 @@ $to = 'example@example.com';
|
|||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
readfile(__DIR__ . "/mb_send_mail03.eml");
|
||||
|
||||
/* English (iso-8859-1) */
|
||||
if (mb_language("english")) {
|
||||
mb_internal_encoding("ISO-8859-1");
|
||||
mb_send_mail($to, "test ".mb_language(), "test");
|
||||
readfile(__DIR__ . "/mb_send_mail03.eml");
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . "/mb_send_mail03.eml");
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
|
|
|
@ -4,15 +4,12 @@ mb_send_mail() test 4 (lang=German)
|
|||
mbstring
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. Not valid for Windows');
|
||||
}
|
||||
if (!function_exists("mb_send_mail") || !mb_language("german")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=/bin/cat
|
||||
sendmail_path={MAIL:{PWD}/mb_send_mail04.eml}
|
||||
mail.add_x_header=off
|
||||
--FILE--
|
||||
<?php
|
||||
|
@ -20,13 +17,19 @@ $to = 'example@example.com';
|
|||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
readfile(__DIR__ . "/mb_send_mail04.eml");
|
||||
|
||||
/* German (iso-8859-15) */
|
||||
if (mb_language("german")) {
|
||||
mb_internal_encoding("ISO-8859-15");
|
||||
mb_send_mail($to, "Pr"."\xfc"."fung ".mb_language(), "Pr"."\xfc"."fung");
|
||||
readfile(__DIR__ . "/mb_send_mail04.eml");
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . "/mb_send_mail04.eml");
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
|
|
|
@ -4,9 +4,6 @@ mb_send_mail() test 5 (lang=Simplified Chinese)
|
|||
mbstring
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. Not valid for Windows');
|
||||
}
|
||||
if (!function_exists("mb_send_mail") || !mb_language("Simplified Chinese")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
|
@ -15,7 +12,7 @@ if (!@mb_internal_encoding('GB2312')) {
|
|||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=/bin/cat
|
||||
sendmail_path={MAIL:{PWD}/mb_send_mail05.eml}
|
||||
mail.add_x_header=off
|
||||
--FILE--
|
||||
<?php
|
||||
|
@ -23,13 +20,19 @@ $to = 'example@example.com';
|
|||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
readfile(__DIR__ . "/mb_send_mail05.eml");
|
||||
|
||||
/* Simplified Chinese (HK-GB-2312) */
|
||||
if (mb_language("simplified chinese")) {
|
||||
mb_internal_encoding('GB2312');
|
||||
mb_send_mail($to, "²âÑé ".mb_language(), "²âÑé");
|
||||
readfile(__DIR__ . "/mb_send_mail05.eml");
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . "/mb_send_mail05.eml");
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
|
|
|
@ -4,9 +4,6 @@ mb_send_mail() test 6 (lang=Traditional Chinese)
|
|||
mbstring
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. Not valid for Windows');
|
||||
}
|
||||
if (!function_exists("mb_send_mail") || !mb_language("Traditional Chinese")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
|
@ -15,7 +12,7 @@ if (!@mb_internal_encoding('BIG5')) {
|
|||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=/bin/cat
|
||||
sendmail_path={MAIL:{PWD}/mb_send_mail06.eml}
|
||||
mail.add_x_header=off
|
||||
--FILE--
|
||||
<?php
|
||||
|
@ -23,13 +20,19 @@ $to = 'example@example.com';
|
|||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
readfile(__DIR__ . "/mb_send_mail06.eml");
|
||||
|
||||
/* Traditional Chinese () */
|
||||
if (mb_language("traditional chinese")) {
|
||||
mb_internal_encoding('BIG5');
|
||||
mb_send_mail($to, "´úÅç ".mb_language(), "´úÅç");
|
||||
readfile(__DIR__ . "/mb_send_mail06.eml");
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . "/mb_send_mail06.eml");
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
|
|
|
@ -4,9 +4,6 @@ mb_send_mail() test 7 (lang=Korean)
|
|||
mbstring
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||
die('skip.. Not valid for Windows');
|
||||
}
|
||||
if (!function_exists("mb_send_mail") || !mb_language("Korean")) {
|
||||
die("skip mb_send_mail() not available");
|
||||
}
|
||||
|
@ -15,7 +12,7 @@ if (!@mb_internal_encoding('ISO-2022-KR')) {
|
|||
}
|
||||
?>
|
||||
--INI--
|
||||
sendmail_path=/bin/cat
|
||||
sendmail_path={MAIL:{PWD}/mb_send_mail07.eml}
|
||||
mail.add_x_header=off
|
||||
--FILE--
|
||||
<?php
|
||||
|
@ -23,13 +20,19 @@ $to = 'example@example.com';
|
|||
|
||||
/* default setting */
|
||||
mb_send_mail($to, mb_language(), "test");
|
||||
readfile(__DIR__ . "/mb_send_mail07.eml");
|
||||
|
||||
/* Korean */
|
||||
if (mb_language("korean")) {
|
||||
mb_internal_encoding('EUC-KR');
|
||||
mb_send_mail($to, "테스트 ".mb_language(), "테스트");
|
||||
readfile(__DIR__ . "/mb_send_mail07.eml");
|
||||
}
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(__DIR__ . "/mb_send_mail07.eml");
|
||||
?>
|
||||
--EXPECTF--
|
||||
To: example@example.com
|
||||
Subject: %s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue