Skip to content

Run mb_send_mail tests on Windows, too #7908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions ext/mbstring/tests/bug52681.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@ 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
$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
Expand Down
11 changes: 7 additions & 4 deletions ext/mbstring/tests/mb_send_mail01.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,32 @@ 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
$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
Expand Down
11 changes: 7 additions & 4 deletions ext/mbstring/tests/mb_send_mail02.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,32 @@ 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
$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
Expand Down
11 changes: 7 additions & 4 deletions ext/mbstring/tests/mb_send_mail03.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,32 @@ 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
$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
Expand Down
11 changes: 7 additions & 4 deletions ext/mbstring/tests/mb_send_mail04.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,32 @@ 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
$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
Expand Down
11 changes: 7 additions & 4 deletions ext/mbstring/tests/mb_send_mail05.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -15,21 +12,27 @@ 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
$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
Expand Down
11 changes: 7 additions & 4 deletions ext/mbstring/tests/mb_send_mail06.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -15,21 +12,27 @@ 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
$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
Expand Down
11 changes: 7 additions & 4 deletions ext/mbstring/tests/mb_send_mail07.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -15,21 +12,27 @@ 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
$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
Expand Down