]> granicus.if.org Git - php/commitdiff
Fixed tests (win32)
authorDmitry Stogov <dmitry@php.net>
Wed, 18 Apr 2007 14:51:29 +0000 (14:51 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 18 Apr 2007 14:51:29 +0000 (14:51 +0000)
ext/standard/tests/file/bug22414.phpt
ext/standard/tests/file/bug24313.phpt
ext/standard/tests/file/bug26615.phpt
ext/standard/tests/file/bug26938.phpt
ext/standard/tests/file/bug39367.phpt
ext/standard/tests/file/mkdir-002.phpt
ext/standard/tests/file/stream_001.phpt
ext/standard/tests/strings/pathinfo.phpt
ext/standard/tests/time/bug38524.phpt

index 0775fc8a7a82ad6a064dcf7183687526416e0d37..b60b865e742497805532d3827e552f48afa541d0 100644 (file)
@@ -16,8 +16,13 @@ output_handler=
 
        /* Binary Data Test */
        
-       $cmd = $php . ' -n -r \"readfile(@getenv(\'TEST_PHP_EXECUTABLE\')); \"';
-       $cmd = $php . ' -n -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ;
+       if (substr(PHP_OS, 0, 3) != 'WIN') {
+               $cmd = $php . ' -n -r \"readfile(@getenv(\'TEST_PHP_EXECUTABLE\')); \"';
+               $cmd = $php . ' -n -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ;
+       } else {
+               $cmd = $php . ' -n -r \"readfile(@getenv(\\\\\\"TEST_PHP_EXECUTABLE\\\\\\")); \"';
+               $cmd = $php . ' -n -r " passthru(\''.$cmd.'\');" > '.$tmpfile ;
+       }
        exec($cmd);
 
        if (md5_file($php) == md5_file($tmpfile)) {
index 04057c58a3c9927e1eaffe14cd9be5c6db914c7e..e5bceee856f7d3ad4bfe3df2f0d75e902e9682ee 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Bug #24313 (file_exists() throws a warning on nonexistent files when is open_basedir enabled)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip "/dev" is not available');
+}
+?>
 --INI--
 open_basedir=/dev
 --FILE--
index 34d71e4b384595b2938aee7e12c01a1d15eed1d9..4de8b4a463bc2576290d0dc8c018fa1761e53516 100644 (file)
@@ -6,7 +6,11 @@ variables_order=E
 <?php
 $out = array();
 $status = -1;
-exec($_ENV['TEST_PHP_EXECUTABLE'].' -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status);
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+       exec($_ENV['TEST_PHP_EXECUTABLE'].' -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status);
+} else {
+       exec($_ENV['TEST_PHP_EXECUTABLE'].' -r "for($i=1;$i<=5000;$i++) echo $i,\' \';"', $out, $status);
+}
 print_r($out);
 ?>
 --EXPECT--
index 8e059ee840336d4dc3585dec8407dcb4d1468f73..c43e6b1033ca0e7550bbaf751b84491c922dd69c 100644 (file)
@@ -5,12 +5,21 @@ Bug #26938 (exec does not read consecutive long lines correctly)
 $out = array();
 $status = -1;
 $php = getenv('TEST_PHP_EXECUTABLE');
-exec($php . ' -r \'' 
-     . '$lengths = array(10,20000,10000,5,10000,3);'
-     . 'foreach($lengths as $length) {'
-     . '  for($i=0;$i<$length;$i++) print chr(65+$i % 27);'
-     . '  print "\n";'
-     . '}\'', $out, $status);
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+       exec($php . ' -r \'' 
+            . '$lengths = array(10,20000,10000,5,10000,3);'
+            . 'foreach($lengths as $length) {'
+            . '  for($i=0;$i<$length;$i++) print chr(65+$i % 27);'
+            . '  print "\n";'
+            . '}\'', $out, $status);
+} else {
+       exec($php . ' -r "' 
+            . '$lengths = array(10,20000,10000,5,10000,3);'
+            . 'foreach($lengths as $length) {'
+            . '  for($i=0;$i<$length;$i++) print chr(65+$i % 27);'
+            . '  print \\"\\n\\";'
+            . '}"', $out, $status);
+}
 for ($i=0;$i<6;$i++)
      print "md5(line $i)= " . md5($out[$i]) . " (length " .
 strlen($out[$i]) . ")\n";
index 667e33dca1a0cc571fd516a5a2f94b543d5cddcc..01fb5e8c84fc6bcf28a52828441ee0962f9a48f1 100755 (executable)
@@ -1,5 +1,11 @@
 --TEST--
 Bug #39367 (clearstatcache() doesn't clear realpath cache)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip no symlinks on Windows');
+}
+?>
 --FILE--
 <?php
 function test() {
index bc4f19acaea4b2e19308a30ded4f84e74264ece7..ccfd6c3d741ea87328c6bfe3cc1c4eba17d361aa 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 mkdir(dir, 0777) tests
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip no symlinks on Windows');
+}
+?>
 --FILE--
 <?php
 
index 8a3f03409b4f379d09190d12cd57bb3a653ae2d2..6df43471ea6162a653823a975d69f2addf6c4d47 100644 (file)
@@ -17,7 +17,7 @@ Notice: fopen(): Unable to find the wrapper "file" - did you forget to enable it
 
 Warning: fopen(): Plainfiles wrapper disabled in %s on line %d
 
-Warning: fopen(file:///%s): failed to open stream: no suitable wrapper could be found in %s on line %d
+Warning: fopen(file://%s): failed to open stream: no suitable wrapper could be found in %s on line %d
 bool(false)
 bool(true)
 resource(%d) of type (stream)
index c1d58f05b31d9be719c490514bd61307dfecf369..d9c3a2ed6c8136fc1cb29e3d1bb458801d63f695 100644 (file)
@@ -57,7 +57,7 @@ array(4) {
 }
 array(3) {
   ["dirname"]=>
-  string(1) "/"
+  string(1) "%e"
   ["basename"]=>
   string(0) ""
   ["filename"]=>
@@ -75,7 +75,7 @@ array(4) {
 }
 array(4) {
   ["dirname"]=>
-  string(1) "/"
+  string(1) "%e"
   ["basename"]=>
   string(1) "."
   ["extension"]=>
@@ -96,13 +96,13 @@ array(4) {
 string(12) "pathinfo.php"
 string(8) "pathinfo"
 string(3) "php"
-string(%d) "%s/strings"
-string(%d) "%s/strings"
+string(%d) "%s%estrings"
+string(%d) "%s%estrings"
 string(12) "pathinfo.php"
 string(3) "php"
 string(12) "pathinfo.php"
-string(%d) "%s/strings"
+string(%d) "%s%estrings"
 string(12) "pathinfo.php"
-string(%d) "%s/strings"
-string(%d) "%s/strings"
+string(%d) "%s%estrings"
+string(%d) "%s%estrings"
 Done
index e9ccaaf38ab0498016dec376711aa690577471a4..77d0f4f2341b1e7589005f8fb37b847d8d44e33b 100755 (executable)
@@ -1,5 +1,7 @@
 --TEST--
 Bug #38524 (strptime() does not initialize the internal date storage structure)
+--SKIPIF--
+<?php if (!function_exists('strptime')) echo "SKIP"; ?>
 --FILE--
 <?php
        var_dump(strptime('2006-08-20', '%Y-%m-%d'));