]> granicus.if.org Git - php/commitdiff
forked test for windows
authorAnatol Belski <ab@php.net>
Thu, 16 Jul 2015 13:04:41 +0000 (15:04 +0200)
committerAnatol Belski <ab@php.net>
Thu, 16 Jul 2015 13:05:04 +0000 (15:05 +0200)
ext/standard/tests/general_functions/bug70018-win32.phpt [new file with mode: 0644]
ext/standard/tests/general_functions/bug70018.phpt

diff --git a/ext/standard/tests/general_functions/bug70018-win32.phpt b/ext/standard/tests/general_functions/bug70018-win32.phpt
new file mode 100644 (file)
index 0000000..427d816
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+Bug #70018 (exec does not strip all whitespace), var 2
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != "WIN") {
+  die("skip.. only for Windows");
+}
+if ("cli" != php_sapi_name()) {
+  die("skip.. CLI only test");
+}
+?>
+--FILE--
+<?php
+$output = array();
+
+$test_fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . md5(uniqid());
+file_put_contents($test_fl, '<?php echo "abc\f\n \n";');
+
+exec(PHP_BINARY . " -n $test_fl", $output);
+
+var_dump($output);
+
+@unlink($test_fl);
+?>
+--EXPECT--
+array(2) {
+  [0]=>
+  string(3) "abc"
+  [1]=>
+  string(0) ""
+}
index 4862010a313cbed1b2fe966d25ba87383c8d161f..86850060928864ae2379b0152925e2336734710e 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
-Bug #70018 (exec does not strip all whitespace)
+Bug #70018 (exec does not strip all whitespace), var 1
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == "WIN") {
+  die("skip.. not for Windows");
+}
+?>
 --FILE--
 <?php
 $output = array();