]> granicus.if.org Git - php/commitdiff
Rewrite test to avoid sending emails
authorMatteo Beccati <mbeccati@php.net>
Wed, 6 Jul 2016 05:08:43 +0000 (07:08 +0200)
committerMatteo Beccati <mbeccati@php.net>
Wed, 6 Jul 2016 05:08:43 +0000 (07:08 +0200)
A properly configured email server was generating bounce emails when running
the test.

ext/pcre/tests/bug72463.phpt
ext/pcre/tests/bug72463_2.phpt [new file with mode: 0644]

index 3d384949171a65411c0b22717b4d091b94e73bdf..b40a7219983987d1c29e04d202db189fee868b52 100644 (file)
@@ -1,13 +1,15 @@
 --TEST--
 Bug #72463 mail fails with invalid argument
---FILE--
+--SKIPIF--
 <?php
-
 if(substr(PHP_OS, 0, 3) == "WIN") {
-       ini_set("smtp", "non.existent.smtp.server");
-} else {
-       ini_set("sendmail_path", "echo hello >/dev/null");
+       die('skip not for windows');
 }
+?>
+--INI--
+sendmail_path="echo >/dev/null"
+--FILE--
+<?php
 
 mail("some.address.it.wont.ever.reach@lookup.and.try.to.find.this.host.name","subject","a", "");
 mail("some.address.it.wont.ever.reach@lookup.and.try.to.find.this.host.name","subject","a", NULL);
diff --git a/ext/pcre/tests/bug72463_2.phpt b/ext/pcre/tests/bug72463_2.phpt
new file mode 100644 (file)
index 0000000..1baeb0f
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+Bug #72463 mail fails with invalid argument
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) != "WIN") {
+       die('skip windows only');
+}
+?>
+--INI--
+SMTP=non.existent.smtp.server
+--FILE--
+<?php
+
+mail("some.address.it.wont.ever.reach@lookup.and.try.to.find.this.host.name","subject","a", "");
+mail("some.address.it.wont.ever.reach@lookup.and.try.to.find.this.host.name","subject","a", NULL);
+
+?>
+===DONE===
+--EXPECTREGEX--
+.*===DONE===