]> granicus.if.org Git - php/commitdiff
Fixed tests which fail from time to time because of race conditions ("echo" command...
authorDmitry Stogov <dmitry@php.net>
Tue, 22 Sep 2009 14:52:47 +0000 (14:52 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 22 Sep 2009 14:52:47 +0000 (14:52 +0000)
ext/standard/tests/mail/mail_basic2.phpt
ext/standard/tests/mail/mail_variation2.phpt

index 8f9ef64135b5b02f68d8d30353eb266ccc56a5df..f5d98574d60e892beca178c9b88d5fe6df925974 100644 (file)
@@ -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===
index 59ef1d9028a8abd50e1fbad93707a296166ff5be..736b05f79a2bb95965cb76cc72ea6699592d164c 100644 (file)
@@ -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===