summaryrefslogtreecommitdiff
path: root/ext/standard/tests/mail
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2009-09-22 14:52:47 +0000
committerDmitry Stogov <dmitry@php.net>2009-09-22 14:52:47 +0000
commit38cdb16dd2a6700aa6d2d61fc790cae9defc95a8 (patch)
treec67ef624d0fec230bf1f5e9729af956a86845acf /ext/standard/tests/mail
parent452aca97e37a8c4d078332914945665b06ed860f (diff)
downloadphp-git-38cdb16dd2a6700aa6d2d61fc790cae9defc95a8.tar.gz
Fixed tests which fail from time to time because of race conditions ("echo" command didn't wait for all the data php tried to send and as result php got a SIGPIPE)
Diffstat (limited to 'ext/standard/tests/mail')
-rw-r--r--ext/standard/tests/mail/mail_basic2.phpt14
-rw-r--r--ext/standard/tests/mail/mail_variation2.phpt10
2 files changed, 14 insertions, 10 deletions
diff --git a/ext/standard/tests/mail/mail_basic2.phpt b/ext/standard/tests/mail/mail_basic2.phpt
index 8f9ef64135..f5d98574d6 100644
--- a/ext/standard/tests/mail/mail_basic2.phpt
+++ b/ext/standard/tests/mail/mail_basic2.phpt
@@ -6,7 +6,7 @@ if(substr(PHP_OS, 0, 3) == "WIN")
die("skip Won't run on Windows");
?>
--INI--
-sendmail_path="echo --- > /tmp/php_test_mailBasic2.out"
+sendmail_path="sed > /tmp/php_test_mailBasic2.out"
--FILE--
<?php
/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
@@ -23,7 +23,7 @@ $to = 'user@company.com';
$subject = 'Test Subject';
$message = 'A Message';
$additional_headers = 'KHeaders';
-$additional_parameters = "Extras";
+$additional_parameters = "-e '5 a--- Extras'";
$outFile = "/tmp/php_test_mailBasic2.out";
@unlink($outFile);
@@ -31,11 +31,6 @@ echo "-- extra parameters --\n";
// Calling mail() with all possible arguments
var_dump( mail($to, $subject, $message, $additional_headers, $additional_parameters) );
-//This test is just using a shell command (see the INI setting). The sleep()
-//is used because that can take a while. If you see the test failing sometimes try
-//increasing the length of the sleep.
-
-sleep(5);
echo file_get_contents($outFile);
unlink($outFile);
?>
@@ -44,5 +39,10 @@ unlink($outFile);
*** Testing mail() : basic functionality ***
-- extra parameters --
bool(true)
+To: user@company.com
+Subject: Test Subject
+KHeaders
+
+A Message
--- Extras
===DONE===
diff --git a/ext/standard/tests/mail/mail_variation2.phpt b/ext/standard/tests/mail/mail_variation2.phpt
index 59ef1d9028..736b05f79a 100644
--- a/ext/standard/tests/mail/mail_variation2.phpt
+++ b/ext/standard/tests/mail/mail_variation2.phpt
@@ -1,8 +1,8 @@
--TEST--
Test mail() function : variation force extra parameters
--INI--
-sendmail_path="echo --- > /tmp/php_test_mailVariation2.out"
-mail.force_extra_parameters="forced params"
+sendmail_path="sed > /tmp/php_test_mailVariation2.out"
+mail.force_extra_parameters="-e4a---forced-params"
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == "WIN")
@@ -35,5 +35,9 @@ unlink($outFile);
--EXPECT--
*** Testing mail() : basic functionality ***
bool(true)
---- forced params
+To: user@company.com
+Subject: Test Subject
+
+A Message
+---forced-params
===DONE===