com php-src: fix tests on Windows: sapi/cgi/tests/003.phpt sapi/cgi/tests/004.phpt sapi/cgi/tests/005.phpt sapi/cgi/tests/006.phpt
| From: | Anatol Belski | Date: | Wed, 30 Sep 2015 09:13:28 +0000 |
| Subject: | com php-src: fix tests on Windows: sapi/cgi/tests/003.phpt sapi/cgi/tests/004.phpt sapi/cgi/tests/005.phpt sapi/cgi/tests/006.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89238@lists.php.net to get a copy of this message | ||
Commit: e80306cbe89c75e3cbedf526134b3c4bcc1d6082
Author: Anatol Belski <ab@php.net> Wed, 30 Sep 2015 09:16:02 +0200
Parents: 353d996c9f21da123d01bc26bda36766e0ce73b9
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e80306cbe89c75e3cbedf526134b3c4bcc1d6082
Log:
fix tests on Windows
Changed paths:
M sapi/cgi/tests/003.phpt
M sapi/cgi/tests/004.phpt
M sapi/cgi/tests/005.phpt
M sapi/cgi/tests/006.phpt
Diff:
diff --git a/sapi/cgi/tests/003.phpt b/sapi/cgi/tests/003.phpt
index 5337433..1ba94f2 100644
--- a/sapi/cgi/tests/003.phpt
+++ b/sapi/cgi/tests/003.phpt
@@ -2,6 +2,11 @@
strip comments and whitespace with -w
--SKIPIF--
<?php
+
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die ("skip not for Windows");
+}
+
include "skipif.inc";
?>
--FILE--
diff --git a/sapi/cgi/tests/004.phpt b/sapi/cgi/tests/004.phpt
index 8769126..0e71170 100644
--- a/sapi/cgi/tests/004.phpt
+++ b/sapi/cgi/tests/004.phpt
@@ -26,7 +26,11 @@ var_dump(test::$pri);
file_put_contents($filename, $code);
-var_dump(
$php -n -f "$filename" 2>/dev/null);
+if (defined("PHP_WINDOWS_VERSION_MAJOR")) {
+ var_dump($php -n -f "$filename");
+} else {
+ var_dump($php -n -f "$filename" 2>/dev/null);
+}
var_dump($php -n -f "wrong");
@unlink($filename);
diff --git a/sapi/cgi/tests/005.phpt b/sapi/cgi/tests/005.phpt
index 34a28f9..259005f 100644
--- a/sapi/cgi/tests/005.phpt
+++ b/sapi/cgi/tests/005.phpt
@@ -1,7 +1,14 @@
--TEST--
using invalid combinations of cmdline options
--SKIPIF--
-<?php include "skipif.inc"; ?>
+<?php
+
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die ("skip not for Windows");
+}
+
+include "skipif.inc";
+?>
--FILE--
<?php
diff --git a/sapi/cgi/tests/006.phpt b/sapi/cgi/tests/006.phpt
index a2b2b29..08bfbf5 100644
--- a/sapi/cgi/tests/006.phpt
+++ b/sapi/cgi/tests/006.phpt
@@ -44,7 +44,11 @@ class test
file_put_contents($filename, $code);
-var_dump("$php" -n -l "$filename" 2>/dev/null);
+if (defined("PHP_WINDOWS_VERSION_MAJOR")) {
+ var_dump("$php" -n -l "$filename");
+} else {
+ var_dump("$php" -n -l "$filename" 2>/dev/null);
+}
@unlink($filename);