]> granicus.if.org Git - php/commitdiff
- fix/sync tests
authorPierre Joye <pajoye@php.net>
Sun, 7 Feb 2010 21:07:10 +0000 (21:07 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 7 Feb 2010 21:07:10 +0000 (21:07 +0000)
39 files changed:
ext/standard/tests/file/005_variation2-win32.phpt
ext/standard/tests/file/bug47767.phpt
ext/standard/tests/file/chmod_variation3.phpt
ext/standard/tests/file/fflush_basic.phpt
ext/standard/tests/file/fgetss_basic1.phpt
ext/standard/tests/file/fgetss_basic2-win32.phpt
ext/standard/tests/file/fgetss_variation1-win32.phpt
ext/standard/tests/file/fgetss_variation3-win32.phpt
ext/standard/tests/file/fgetss_variation4.phpt
ext/standard/tests/file/fgetss_variation5-win32.phpt
ext/standard/tests/file/file.inc
ext/standard/tests/file/fopen_variation10-win32.phpt
ext/standard/tests/file/fopen_variation11-win32.phpt
ext/standard/tests/file/fopen_variation17.phpt
ext/standard/tests/file/fpassthru_basic.phpt
ext/standard/tests/file/mkdir_variation1-win32.phpt
ext/standard/tests/file/rename_variation-win32.phpt
ext/standard/tests/file/rename_variation11-win32.phpt
ext/standard/tests/file/rename_variation12-win32.phpt [new file with mode: 0644]
ext/standard/tests/file/rename_variation12.phpt
ext/standard/tests/file/rename_variation13-win32.phpt
ext/standard/tests/file/rename_variation13.phpt
ext/standard/tests/file/rename_variation3-win32.phpt
ext/standard/tests/file/rename_variation6-win32.phpt
ext/standard/tests/file/rename_variation8-win32.phpt [new file with mode: 0644]
ext/standard/tests/file/rename_variation8.phpt
ext/standard/tests/file/rename_variation9.phpt
ext/standard/tests/file/rmdir_variation1-win32.phpt
ext/standard/tests/file/rmdir_variation1.phpt
ext/standard/tests/file/tempnam_variation3-win32.phpt
ext/standard/tests/file/tempnam_variation3.phpt
ext/standard/tests/file/tempnam_variation7-win32.phpt
ext/standard/tests/file/tempnam_variation7.phpt
ext/standard/tests/file/unlink_error-win32.phpt
ext/standard/tests/file/userstreams_003.phpt
ext/standard/tests/file/windows_acls/common.inc
ext/standard/tests/file/windows_links/bug48746.phpt
ext/standard/tests/file/windows_links/bug48746_2.phpt
ext/standard/tests/file/windows_links/bug48746_3.phpt

index 513182ddeb86ac5483253b7b187cdc540e37339e..45dcbc5f071c377e4c8882dfcad95d2f5e6d7b24 100644 (file)
@@ -108,18 +108,18 @@ Warning: filectime(): stat failed for | in %s on line %d
 
 
 *** testing touch ***
-Warning: touch(): Unable to create file  because %s in %s on line %d
+Warning: touch(): %s in %s on line %d
 bool(false)
 
-Warning: touch(): Unable to create file  because %s in %s on line %d
+Warning: touch(): %s in %s on line %d
 bool(false)
 
-Warning: touch(): Unable to create file  because %s in %s on line %d
+Warning: touch(): %s in %s on line %d
 bool(false)
 
-Warning: touch(): Unable to create file   because %s in %s on line %d
+Warning: touch(): %s in %s on line %d
 bool(false)
 
-Warning: touch(): Unable to create file | because %s in %s on line %d
+Warning: touch(): %s in %s on line %d
 bool(false)
 Done
index 62388c28cb6fa6623caa41962c550aaae67dc85e..312476aa55232913e6412a1b89940ed599c0349c 100644 (file)
@@ -10,6 +10,11 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) {
 if(PHP_WINDOWS_VERSION_MAJOR < 6)  {
         die('skip windows version 6.0+ only test');
 }
+
+$ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out);
+if (strpos($ret, 'privilege')) {
+       die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');
+}
 ?>
 --FILE--
 <?php
index c2dd607fe2a97d46855f3942a0a3f45df1243cfe..df18ccf986c23a19b4f4af48ad2f5fea58500326 100644 (file)
@@ -159,11 +159,11 @@ Error: 2 - chmod() expects parameter 1 to be string, array given, %s(%d)
 NULL
 
 --uppercase NULL--
-Error: 2 - chmod(): No such file or directory, %s(%d)
+Error: 2 - chmod(): %s, %s(%d)
 bool(false)
 
 --lowercase null--
-Error: 2 - chmod(): No such file or directory, %s(%d)
+Error: 2 - chmod(): %s, %s(%d)
 bool(false)
 
 --lowercase true--
@@ -171,7 +171,7 @@ Error: 2 - chmod(): No such file or directory, %s(%d)
 bool(false)
 
 --lowercase false--
-Error: 2 - chmod(): No such file or directory, %s(%d)
+Error: 2 - chmod(): %s, %s(%d)
 bool(false)
 
 --uppercase TRUE--
@@ -179,15 +179,15 @@ Error: 2 - chmod(): No such file or directory, %s(%d)
 bool(false)
 
 --uppercase FALSE--
-Error: 2 - chmod(): No such file or directory, %s(%d)
+Error: 2 - chmod(): %s, %s(%d)
 bool(false)
 
 --empty string DQ--
-Error: 2 - chmod(): No such file or directory, %s(%d)
+Error: 2 - chmod(): %s, %s(%d)
 bool(false)
 
 --empty string SQ--
-Error: 2 - chmod(): No such file or directory, %s(%d)
+Error: 2 - chmod(): %s, %s(%d)
 bool(false)
 
 --instance of classWithToString--
@@ -199,11 +199,11 @@ Error: 2 - chmod() expects parameter 1 to be string, object given, %s(%d)
 NULL
 
 --undefined var--
-Error: 2 - chmod(): No such file or directory, %s(%d)
+Error: 2 - chmod(): %s, %s(%d)
 bool(false)
 
 --unset var--
-Error: 2 - chmod(): No such file or directory, %s(%d)
+Error: 2 - chmod(): %s, %s(%d)
 bool(false)
 ===DONE===
 
index 5cd81d7aa2a801577f7d008f37beb346c61a7a7c..f375c4f0794a3a345fbe9524c7668b93f0dd95f0 100755 (executable)
@@ -21,6 +21,10 @@ $file_handle = fopen($filename, "w");
 if($file_handle == false)
   exit("Error:failed to open file $filename");
 
+if(substr(PHP_OS, 0, 3) == "WIN")  {
+       $data = str_replace("\r",'', $data);
+}
+
 // writing data to the file
 var_dump( fwrite($file_handle, $data) );
 var_dump( fflush($file_handle) );
index ab9eae0be29c629ad2b83e580ea33611b7e7f0db..4c5881d5881317b6e309d636301506f0cf096973 100644 (file)
@@ -22,7 +22,9 @@ is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg>
 <html> html </html> <?php echo "php"; ?>
 EOT;
 
-
+if(substr(PHP_OS, 0, 3) == "WIN")  {
+       $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
 /* try reading the file opened in different modes of reading */
 $file_modes = array("r","rb", "rt","r+", "r+b", "r+t");
 
@@ -62,7 +64,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
 
 echo "Done\n";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing fgetss() : Basic operations ***
 
 -- Testing fgetss() with file opened using r mode --
index 5a87b4c0395e5f6e80f0c94e3fc6b86c7798bd7e..9187fe532a2897123f6730902faa585be2ac4f66 100644 (file)
@@ -29,7 +29,9 @@ $string_with_tags = <<<EOT
 is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg>
 <html> html </html> <?php echo "php"; ?>
 EOT;
-
+if(substr(PHP_OS, 0, 3) == "WIN")  {
+       $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
 $filename = dirname(__FILE__)."/fgetss_basic2.tmp"; 
 
 /* try reading the file opened in different modes of reading */
index dc3ee930c7fe6d0dd6ccf99212ff9a4b2ef1b2c0..0aca5d37609e264f22296178504e79bbca78d1e9 100644 (file)
@@ -36,6 +36,10 @@ this text contains some html tags <body> body </body> <br> br </br>
 this is the line with \n character. 
 EOT;
 
+if(substr(PHP_OS, 0, 3) == "WIN")  {
+       $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
+
 $filename = dirname(__FILE__)."/fgetss_variation1.tmp";
 
 /* try reading the file opened in different modes of reading */
@@ -73,7 +77,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
 
 echo "Done\n";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing fgetss() : usage variations ***
 
 -- Testing fgetss() with file opened using w mode --
index ea8ee2f8c6a08a855baab072074b144de59f02d0..7539b3687635d92b4b0b8a2658f5409f3c5734e0 100644 (file)
@@ -35,6 +35,10 @@ this text contains some html tags <body> body </body> <br> br </br>
 this is the line with \n character. 
 EOT;
 
+if(substr(PHP_OS, 0, 3) == "WIN")  {
+       $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
+
 $filename = dirname(__FILE__)."/fgetss_variation3.tmp"; 
 
 /* try reading the file opened in different modes of reading */
@@ -76,7 +80,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
 
 echo "Done\n";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing fgetss() : usage variations ***
 
 -- Testing fgetss() with file opened using w+ mode --
index 134a9652abf706bd3d3506e7430b29acc744e610..6c201d1a9e66c33d0fcb4ccd3a2d6389f9fcbbe9 100644 (file)
@@ -1,5 +1,10 @@
 --TEST--
 Test fgetss() function : usage variations - read  modes, file pointer at EOF
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN")
+  die("skip not for Windows");
+?>
 --FILE--
 <?php
 /*
index d806ddd47df703ab1d5655f2c6171e7ee4fbc65b..cedc7b98da6f33be37d92eb728261235ac96e687 100644 (file)
@@ -33,6 +33,9 @@ this is a line with more than eighty character,want to check line splitting corr
 this text contains some html tags <body> body </body> <br> br </br>
 this is the line with \n character. 
 EOT;
+if(substr(PHP_OS, 0, 3) == "WIN")  {
+       $string_with_tags = str_replace("\r",'', $string_with_tags);
+}
 
 $filename = dirname(__FILE__)."/fgetss_variation5.tmp"; 
 
@@ -77,7 +80,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
 
 echo "Done\n";
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing fgetss() : usage variations ***
 
 -- Testing fgetss() with file opened using w+ mode --
index efb425ca42239bbd29c017c5c9e3e690e1d817d7..c0f86e7c3fa1d439c0470d5c38387983c93ae3f4 100644 (file)
@@ -347,16 +347,16 @@ function create_files( $file_path,
      filled => total files filled, always returned as 1
      perms_changed => total files permission changed
 */
-function create_links( $file_path,
-                      $filename,
-                       $link_count = 1,
-                       $link_type = "soft",
-                       $link_size = 1024,
-                       $link_name_prefix = "link",
-                       $link_name_suffix = 1,
-                       $link_file_content = "text",
-                       $link_perms = 0755,
-                       $link_file_extension = ".tmp"
+function create_links($file_path,
+                      $filename,
+                      $link_count = 1,
+                      $link_type = "soft",
+                      $link_size = 1024,
+                      $link_name_prefix = "link",
+                      $link_name_suffix = 1,
+                      $link_file_content = "text",
+                      $link_perms = 0755,
+                      $link_file_extension = ".tmp"
                      )
 {
   $return_value = array('created' => 0, 'filled' => 0, 'perms_changed' => 0);
index bf8d3889fae715009992bc270cb27499c72a7f19..c949f86fa2593cf0e1881c1e791719022a992a2b 100644 (file)
@@ -6,6 +6,11 @@ Dave Kelsey <d_kelsey@uk.ibm.com>
 <?php
 if(substr(PHP_OS, 0, 3) != "WIN")
   die("skip Run only on Windows");
+
+if (!is_writable('c:\\fopen_variation10.tmp')) {
+       die('skip. C:\\ not writable.');
+}
+
 ?>
 --FILE--
 <?php
index cc33a4eb499ed19ae5b68ee4ce19b9ac0865152f..61a2f60ecf757d8a7a0ff8be8ab2e23cae588a45 100644 (file)
@@ -6,6 +6,10 @@ Dave Kelsey <d_kelsey@uk.ibm.com>
 <?php
 if(substr(PHP_OS, 0, 3) != "WIN")
   die("skip Run only on Windows");
+if (!is_writable('c:\\fopen_variation10.tmp')) {
+       die('skip. C:\\ not writable.');
+}
+
 ?>
 --FILE--
 <?php
index 75f24b3553af0a613dae3c6ed075007824b2645b..bc75c11c9089a4e6a1cae0d84d5c02cd21ae9e2d 100644 (file)
@@ -37,7 +37,7 @@ function runtest() {
     mkdir($dir1.'/'.$extraDir);
     mkdir($extraDir);
     
-       $tmpfile = $extraDir.'/ basename(__FILE__, ".php") . ".tmp"';
+       $tmpfile = $extraDir . '/' . basename(__FILE__, ".php") . ".tmp";
        $h = fopen($tmpfile, "w+", true);
        fwrite($h, (binary) "This is the test file");
        fclose($h);
index db03abc490ddeae65ed327c2f9152a8508022a2c..8924b27dd229ea128375a9f4fca424cd88149a5d 100644 (file)
@@ -13,7 +13,9 @@ $write_handle = fopen($file_name, "w");
 
 $string = "Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^ 
           Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^\n";
-
+if(substr(PHP_OS, 0, 3) == "WIN")  {
+       $string = str_replace("\r",'', $string);
+}
 fwrite($write_handle, $string);
 fclose($write_handle);
 
index 6dfe3be62a6f22ce0739887f5f56a5d3f38c5730..17f54926cb5d650d4ec7241e30eac2771f7db538 100644 (file)
@@ -94,28 +94,28 @@ foreach($inputs as $key =>$value) {
 *** Testing mkdir() : usage variation ***
 
 --uppercase NULL--
-Error: 2 - mkdir(): No such file or directory, %s(%d)
+Error: 2 - mkdir(): %s, %s(%d)
 
 --lowercase null--
-Error: 2 - mkdir(): No such file or directory, %s(%d)
+Error: 2 - mkdir(): %s, %s(%d)
 
 --lowercase false--
-Error: 2 - mkdir(): No such file or directory, %s(%d)
+Error: 2 - mkdir(): %s, %s(%d)
 
 --uppercase FALSE--
-Error: 2 - mkdir(): No such file or directory, %s(%d)
+Error: 2 - mkdir(): %s, %s(%d)
 
 --empty string DQ--
-Error: 2 - mkdir(): No such file or directory, %s(%d)
+Error: 2 - mkdir(): %s, %s(%d)
 
 --empty string SQ--
-Error: 2 - mkdir(): No such file or directory, %s(%d)
+Error: 2 - mkdir(): %s, %s(%d)
 
 --undefined var--
-Error: 2 - mkdir(): No such file or directory, %s(%d)
+Error: 2 - mkdir(): %s, %s(%d)
 
 --unset var--
-Error: 2 - mkdir(): No such file or directory, %s(%d)
+Error: 2 - mkdir(): %s, %s(%d)
 
 --single space--
 Error: 2 - mkdir(): %s, %s(%d)
index cebf0334c511c3d33ceb0187771d0e4c11734886..a10c6dfbe70c09b3ddeae8a24679c09b5831cca1 100644 (file)
@@ -69,7 +69,7 @@ bool(false)
 bool(true)
 -- Iteration 2 --
 
-Warning: rename(%s/rename_variation/rename_variation.tmp/,%s/rename_variation2.tmp): No such file or directory in %s on line %d
+Warning: rename(%s/rename_variation/rename_variation.tmp/,%s/rename_variation2.tmp): The filename, directory name, or volume label syntax is incorrect. (code: 123) in %s on line %d
 bool(false)
 bool(false)
 bool(false)
index d17b0d283c7ce4689da41aac980a8db778760a12..c13a09a95137ef18227eebcfbed6cfecf015f9ca 100644 (file)
@@ -92,12 +92,12 @@ bool(true)
 
 -- Iteration 5 --
 
-Warning: rename(%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\renameMe.tmp,%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\IwasRenamed.tmp): No such file or directory in %s on line %d
+Warning: rename(%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\renameMe.tmp,%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d
 bool(false)
 
 -- Iteration 6 --
 
-Warning: rename(%s\renameVar11\renameVar11Sub\BADDIR\renameMe.tmp,%s\renameVar11\renameVar11Sub\BADDIR\IwasRenamed.tmp): No such file or directory in %s on line %d
+Warning: rename(%s\renameVar11\renameVar11Sub\BADDIR\renameMe.tmp,%s\renameVar11\renameVar11Sub\BADDIR\IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d
 bool(false)
 
 -- Iteration 7 --
@@ -118,7 +118,7 @@ bool(true)
 
 -- Iteration 11 --
 
-Warning: rename(BADDIR\renameMe.tmp,BADDIR\IwasRenamed.tmp): No such file or directory in %s on line %d
+Warning: rename(BADDIR\renameMe.tmp,BADDIR\IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d
 bool(false)
 
 -- Iteration 12 --
diff --git a/ext/standard/tests/file/rename_variation12-win32.phpt b/ext/standard/tests/file/rename_variation12-win32.phpt
new file mode 100644 (file)
index 0000000..de5fc14
--- /dev/null
@@ -0,0 +1,121 @@
+--TEST--
+Test rename() function : variation - various relative, absolute paths
+--CREDITS--
+Dave Kelsey <d_kelsey@uk.ibm.com>
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') die('skip..  for Windows');
+?>
+--FILE--
+<?php
+/* Prototype  : bool rename(string old_name, string new_name[, resource context])
+ * Description: Rename a file 
+ * Source code: ext/standard/file.c
+ * Alias to functions: 
+ */
+
+/* Creating unique files in various dirs by passing relative paths to $dir arg */
+
+echo "*** Testing rename() with absolute and relative paths ***\n";
+$mainDir = "renameVar11";
+$subDir = "renameVar11Sub";
+$absMainDir = dirname(__FILE__)."/".$mainDir;
+mkdir($absMainDir);
+$absSubDir = $absMainDir."/".$subDir;
+mkdir($absSubDir);
+
+$fromFile = "renameMe.tmp";
+$toFile = "IwasRenamed.tmp";
+
+$old_dir_path = getcwd();
+chdir(dirname(__FILE__));
+
+$allDirs = array(
+  // absolute paths
+  "$absSubDir/",
+  "$absSubDir/../".$subDir,
+  "$absSubDir//.././".$subDir,
+  "$absSubDir/../../".$mainDir."/./".$subDir,
+  "$absSubDir/..///".$subDir."//..//../".$subDir,
+  "$absSubDir/BADDIR",
+  
+  
+  // relative paths
+  $mainDir."/".$subDir,
+  $mainDir."//".$subDir, 
+   $mainDir."///".$subDir, 
+  "./".$mainDir."/../".$mainDir."/".$subDir,
+  "BADDIR",  
+);
+
+for($i = 0; $i<count($allDirs); $i++) {
+  $j = $i+1;
+  $dir = $allDirs[$i];
+  echo "\n-- Iteration $j --\n";
+  touch($absSubDir."/".$fromFile);
+  $res = rename($dir."/".$fromFile, $dir."/".$toFile);
+  var_dump($res);
+  if ($res == true) {
+     $res = rename($dir."/".$toFile, $dir."/".$fromFile);
+     var_dump($res);
+  }
+  unlink($absSubDir."/".$fromFile);
+}
+
+chdir($old_dir_path);
+rmdir($absSubDir);
+rmdir($absMainDir);
+
+echo "\n*** Done ***\n";
+?>
+--EXPECTF--
+*** Testing rename() with absolute and relative paths ***
+
+-- Iteration 1 --
+bool(true)
+bool(true)
+
+-- Iteration 2 --
+bool(true)
+bool(true)
+
+-- Iteration 3 --
+bool(true)
+bool(true)
+
+-- Iteration 4 --
+bool(true)
+bool(true)
+
+-- Iteration 5 --
+
+Warning: rename(%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/renameMe.tmp,%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d
+bool(false)
+
+-- Iteration 6 --
+
+Warning: rename(%s/renameVar11/renameVar11Sub/BADDIR/renameMe.tmp,%s/renameVar11/renameVar11Sub/BADDIR/IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d
+bool(false)
+
+-- Iteration 7 --
+bool(true)
+bool(true)
+
+-- Iteration 8 --
+bool(true)
+bool(true)
+
+-- Iteration 9 --
+bool(true)
+bool(true)
+
+-- Iteration 10 --
+bool(true)
+bool(true)
+
+-- Iteration 11 --
+
+Warning: rename(BADDIR/renameMe.tmp,BADDIR/IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d
+bool(false)
+
+*** Done ***
\ No newline at end of file
index 11274f03d2dbf4647267d7f7707e00f3e2e1abed..168beeffc97b55f0689e0f4993bfca4555601f77 100644 (file)
@@ -2,6 +2,10 @@
 Test rename() function : variation - various relative, absolute paths
 --CREDITS--
 Dave Kelsey <d_kelsey@uk.ibm.com>
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') die('skip..  not for Windows');
+?>
 --FILE--
 <?php
 /* Prototype  : bool rename(string old_name, string new_name[, resource context])
@@ -85,12 +89,12 @@ bool(true)
 
 -- Iteration 5 --
 
-Warning: rename(%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/renameMe.tmp,%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/IwasRenamed.tmp): No such file or directory in %s on line %d
+Warning: rename(%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/renameMe.tmp,%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/IwasRenamed.tmp): %s in %s on line %d
 bool(false)
 
 -- Iteration 6 --
 
-Warning: rename(%s/renameVar11/renameVar11Sub/BADDIR/renameMe.tmp,%s/renameVar11/renameVar11Sub/BADDIR/IwasRenamed.tmp): No such file or directory in %s on line %d
+Warning: rename(%s/renameVar11/renameVar11Sub/BADDIR/renameMe.tmp,%s/renameVar11/renameVar11Sub/BADDIR/IwasRenamed.tmp): %s in %s on line %d
 bool(false)
 
 -- Iteration 7 --
@@ -111,7 +115,7 @@ bool(true)
 
 -- Iteration 11 --
 
-Warning: rename(BADDIR/renameMe.tmp,BADDIR/IwasRenamed.tmp): No such file or directory in %s on line %d
+Warning: rename(BADDIR/renameMe.tmp,BADDIR/IwasRenamed.tmp): %s in %s on line %d
 bool(false)
 
-*** Done ***
\ No newline at end of file
+*** Done ***
index ccbb62185089f93a884886d8c1b9d9ad3cd70fbf..a86025889d31bedfad6b7214ff98c1a4cd9dcd62 100644 (file)
Binary files a/ext/standard/tests/file/rename_variation13-win32.phpt and b/ext/standard/tests/file/rename_variation13-win32.phpt differ
index 123760432624bf82007165085f95c6ae16c7b95e..24697d510567eef0c1015a8c35ead7c37e4e0019 100644 (file)
@@ -5,7 +5,7 @@ Dave Kelsey <d_kelsey@uk.ibm.com>
 --SKIPIF--
 <?php
 if(substr(PHP_OS, 0, 3) == "WIN")
-  die("skip Not for Windows");
+  die("skip. Not for Windows");
 ?>
 --FILE--
 <?php
@@ -15,7 +15,6 @@ if(substr(PHP_OS, 0, 3) == "WIN")
  * Alias to functions: 
  */
 
-
 echo "*** Testing rename() with obscure files ***\n";
 $file_path = dirname(__FILE__)."/renameVar13";
 $aFile = $file_path.'/afile.tmp';
@@ -74,24 +73,24 @@ Warning: rename(1,%s/renameVar13/afile.tmp): No such file or directory in %s on
 bool(false)
 -- testing '' --
 
-Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d
+Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d
 bool(false)
 
-Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d
+Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d
 bool(false)
 -- testing '' --
 
-Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d
+Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d
 bool(false)
 
-Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d
+Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d
 bool(false)
 -- testing '' --
 
-Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d
+Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d
 bool(false)
 
-Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d
+Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d
 bool(false)
 -- testing ' ' --
 bool(true)
@@ -103,7 +102,7 @@ bool(false)
 Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d
 bool(false)
 
-Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d
+Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d
 bool(false)
 -- testing 'Array' --
 
@@ -129,4 +128,4 @@ bool(false)
 Warning: rename(php/php,%s/renameVar13/afile.tmp): %s directory in %s on line %d
 bool(false)
 
-*** Done ***
\ No newline at end of file
+*** Done ***
index b251fc448d0f25110eeb37f340c093fc5ac51c2e..b5da5878111ed96bdf61afb32d41d0b347442b19 100644 (file)
@@ -24,6 +24,9 @@ mkdir($dirname);
 
 $filename = "$file_path/rename_variation3.tmp"; 
 $fp = fopen($filename, "w");
+if (!$fp) {
+       die("Cannot create $filename\n");
+}
 fclose($fp);
 
 echo "\n-- Renaming file to same file name --\n";
@@ -68,7 +71,7 @@ bool(true)
 
 -- Renaming existing file to existing directory name --
 
-Warning: rename(%s/rename_variation3.tmp,%s/rename_variation3_dir): No such file or directory in %s on line %d
+Warning: rename(%s/rename_variation3.tmp,%s/rename_variation3_dir): Access is denied. (code: 5) in %s on line %d
 bool(false)
 bool(true)
 bool(true)
index 6305447b9dc1ffb43ccd1f99820c16b2ca71966d..14d59d0ade8e58aa47e448bc26e4278b0b3804a2 100644 (file)
@@ -4,6 +4,10 @@ Test rename() function: usage variations-6
 <?php
 if (substr(PHP_OS, 0, 3) != 'WIN') die('skip..  for Windows');
 if (!function_exists("symlink")) die("skip symlinks are not supported");
+$ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out);
+if (strpos($ret, 'privilege')) {
+       die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');
+}
 ?>
 --FILE--
 <?php
diff --git a/ext/standard/tests/file/rename_variation8-win32.phpt b/ext/standard/tests/file/rename_variation8-win32.phpt
new file mode 100644 (file)
index 0000000..1d25a12
--- /dev/null
@@ -0,0 +1,70 @@
+--TEST--\r
+Test rename() function: variation\r
+--SKIPIF--\r
+<?php\r
+if (substr(PHP_OS, 0, 3) != 'WIN') die('skip..  for Windows');\r
+?>\r
+--FILE--\r
+<?php\r
+/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );\r
+   Description: Renames a file or directory\r
+*/\r
+\r
+echo "\n*** Testing rename() on non-existing file ***\n";\r
+$file_path = dirname(__FILE__);\r
+\r
+// try renaming a non existing file\r
+$src_name = $file_path."/non_existent_file.tmp";\r
+$dest_name = $file_path."/rename_variation8_new.tmp";\r
+var_dump( rename($src_name, $dest_name) );\r
+\r
+// ensure that $dest_name didn't get created\r
+var_dump( file_exists($src_name) );  // expecting false\r
+var_dump( file_exists($dest_name) ); // expecting false\r
+\r
+// rename a existing dir to new name\r
+echo "\n*** Testing rename() on existing directory ***\n";\r
+$dir_name = $file_path."/rename_basic_dir";\r
+mkdir($dir_name);\r
+$new_dir_name = $file_path."/rename_basic_dir1";\r
+var_dump( rename($dir_name, $new_dir_name) );\r
+//ensure that $new_dir_name got created\r
+var_dump( file_exists($dir_name) );  // expecting false\r
+var_dump( file_exists($new_dir_name) );  // expecting true\r
+\r
+// try to rename an non_existing dir \r
+echo "\n*** Testing rename() on non-existing directory ***\n";\r
+$non_existent_dir_name = $file_path."/non_existent_dir";\r
+$new_dir_name = "$file_path/rename_basic_dir2";\r
+var_dump( rename($non_existent_dir_name, $new_dir_name) );\r
+// ensure that $new_dir_name didn't get created\r
+var_dump( file_exists($non_existent_dir_name) );  // expecting flase\r
+var_dump( file_exists($new_dir_name) );  // expecting false\r
+\r
+echo "Done\n";\r
+?>\r
+--CLEAN--\r
+<?php\r
+rmdir(dirname(__FILE__)."/rename_basic_dir1");\r
+?>\r
+--EXPECTF--\r
+*** Testing rename() on non-existing file ***\r
+\r
+Warning: rename(%s/non_existent_file.tmp,%s/rename_variation8_new.tmp): The system cannot find the file specified. (code: 2) in %s on line %d\r
+bool(false)\r
+bool(false)\r
+bool(false)\r
+\r
+*** Testing rename() on existing directory ***\r
+bool(true)\r
+bool(false)\r
+bool(true)\r
+\r
+*** Testing rename() on non-existing directory ***\r
+\r
+Warning: rename(%s/non_existent_dir,%s/rename_basic_dir2): The system cannot find the file specified. (code: 2) in %s on line %d\r
+bool(false)\r
+bool(false)\r
+bool(false)\r
+Done\r
+\r
index 6b3644aee4973030abcdd9f477bafadb0f795a6e..6e236c376cfc13c10d9b8a41eeadf23303dd3137 100644 (file)
@@ -1,5 +1,9 @@
 --TEST--
 Test rename() function: variation
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') die('skip..  not for Windows');
+?>
 --FILE--
 <?php
 /* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
@@ -41,6 +45,7 @@ echo "Done\n";
 ?>
 --CLEAN--
 <?php
+unlink(dirname(__FILE__)."/rename_basic_new2.tmp");
 rmdir(dirname(__FILE__)."/rename_basic_dir1");
 ?>
 --EXPECTF--
index d923e4a3d43eae3f415061154e8aef837da555f2..272fa9402585e236d0d80e7c94f79fa51665e640 100644 (file)
@@ -41,7 +41,7 @@ echo "Done\n";
 unlink(dirname(__FILE__)."/rename_variation9_new.tmp");
 rmdir(dirname(__FILE__)."/rename_variation_dir9_new");
 ?>
---EXPECTF--
+--EXPECT--
 *** Testing rename() by giving stream context as third argument ***
 bool(true)
 bool(false)
index 0732821c54a27f045c6f7b2d0ce6d88de9956294..2516e6162e42369682fab0c39332fec7213e21c6 100644 (file)
@@ -90,35 +90,35 @@ foreach($inputs as $key =>$value) {
 *** Testing rmdir() : usage variation ***
 
 --uppercase NULL--
-Error: 2 - rmdir(): No such file or directory, %s(%d)
+Error: 2 - rmdir(): %s, %s(%d)
 bool(false)
 
 --lowercase null--
-Error: 2 - rmdir(): No such file or directory, %s(%d)
+Error: 2 - rmdir(): %s, %s(%d)
 bool(false)
 
 --lowercase false--
-Error: 2 - rmdir(): No such file or directory, %s(%d)
+Error: 2 - rmdir(): %s, %s(%d)
 bool(false)
 
 --uppercase FALSE--
-Error: 2 - rmdir(): No such file or directory, %s(%d)
+Error: 2 - rmdir(): %s, %s(%d)
 bool(false)
 
 --empty string DQ--
-Error: 2 - rmdir(): No such file or directory, %s(%d)
+Error: 2 - rmdir(): %s, %s(%d)
 bool(false)
 
 --empty string SQ--
-Error: 2 - rmdir(): No such file or directory, %s(%d)
+Error: 2 - rmdir(): %s, %s(%d)
 bool(false)
 
 --undefined var--
-Error: 2 - rmdir(): No such file or directory, %s(%d)
+Error: 2 - rmdir(): %s, %s(%d)
 bool(false)
 
 --unset var--
-Error: 2 - rmdir(): No such file or directory, %s(%d)
+Error: 2 - rmdir(): %s, %s(%d)
 bool(false)
 
 --single space--
index a7a49900729c9ded93bcb60705fd799cf3d3b4f3..04fee0ee2a0601897668da8fbf578e32dc7a995d 100644 (file)
@@ -81,7 +81,7 @@ $inputs = array(
 
 foreach($inputs as $key =>$value) {
       echo "\n--$key--\n";
-      var_dump( rmdir($value) );
+      var_dump(rmdir($value));
 };
 
 ?>
index 080bce0fb8cc322a588fd88c7c0a66de9a975de0..fb457cb6ab1485fa1f794c444142b43f860fc3a1 100644 (file)
@@ -3,7 +3,7 @@ Test tempnam() function: usage variations - obscure prefixes
 --SKIPIF--
 <?php
 if(substr(PHP_OS, 0, 3) != "WIN")
-  die("skip run only on Windows");
+       die("skip run only on Windows");
 ?>
 --FILE--
 <?php
@@ -15,29 +15,51 @@ if(substr(PHP_OS, 0, 3) != "WIN")
 
 echo "*** Testing tempnam() with obscure prefixes ***\n";
 $file_path = dirname(__FILE__)."/tempnamVar3";
-mkdir($file_path);
+if (!mkdir($file_path)) {
+       echo "Failed, cannot create temp dir $filepath\n";
+       exit(1);
+}
+
+$file_path = realpath($file_path);
 
 /* An array of prefixes */ 
 $names_arr = array(
-  /* Invalid args */ 
-  -1,
-  TRUE,
-  FALSE,
-  NULL,
-  "",
-  " ",
-  "\0",
-  array(),
+       /* Valid args (casting)*/ 
+       -1,
+       TRUE,
+       FALSE,
+       NULL,
+       "",
+       " ",
+       "\0",
+       /* Invalid args */ 
+       array(),
 
-  /* prefix with path separator of a non existing directory*/
-  "/no/such/file/dir", 
-  "php/php"
+       /* Valid args*/ 
+       /* prefix with path separator of a non existing directory*/
+       "/no/such/file/dir", 
+       "php/php"
+);
 
+$res_arr = array(
+       /* Invalid args */ 
+       true,
+       true,
+       true,
+       true,
+       true,
+       true,
+       true,
+       false,
+
+       /* prefix with path separator of a non existing directory*/
+       true, 
+       true
 );
 
 for( $i=0; $i<count($names_arr); $i++ ) {
-  echo "-- Iteration $i --\n";
-  $file_name = tempnam("$file_path", $names_arr[$i]);
+       echo "-- Iteration $i --\n";
+       $file_name = tempnam($file_path, $names_arr[$i]);
 
        /* creating the files in existing dir */
        if (file_exists($file_name) && !$res_arr[$i]) {
@@ -54,75 +76,40 @@ for( $i=0; $i<count($names_arr); $i++ ) {
                if (!is_writable($file_name)) {
                        printf("%o\n", fileperms($file_name) );
 
-    echo "File permissions are => ";
-    printf("%o", fileperms($file_name) );
-    echo "\n";
-    
-    echo "File created in => ";
-    $file_dir = dirname($file_name);
-    if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) {
-       echo "temp dir\n";
-    }
-    else if (realpath($file_dir) == realpath($file_path) || realpath($file_dir."\\") == realpath($file_path)) {    
-       echo "directory specified\n";
-    }
-    else {
-       echo "unknown location\n";
-    }         
-  }
-  else {
-    echo "-- File is not created --\n";
-  }
-
-  unlink($file_name);
+               }
+       } else {
+               echo "OK\n";
+       }
+       @unlink($file_name);
 }
 
 rmdir($file_path);
-echo "\n*** Done ***\n";
+echo "\n*** Done. ***\n";
 ?>
 --EXPECTF--
 *** Testing tempnam() with obscure prefixes ***
 -- Iteration 0 --
-File name is => %s\%s
-File permissions are => 100666
-File created in => directory specified
+OK
 -- Iteration 1 --
-File name is => %s\%s
-File permissions are => 100666
-File created in => directory specified
+OK
 -- Iteration 2 --
-File name is => %s\%s
-File permissions are => 100666
-File created in => directory specified
+OK
 -- Iteration 3 --
-File name is => %s\%s
-File permissions are => 100666
-File created in => directory specified
+OK
 -- Iteration 4 --
-File name is => %s\%s
-File permissions are => 100666
-File created in => directory specified
+OK
 -- Iteration 5 --
 Failed, not created in the correct directory %s vs %s
 0
 -- Iteration 6 --
-File name is => %s\%s
-File permissions are => 100666
-File created in => directory specified
+OK
 -- Iteration 7 --
 
-Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d
--- File is not created --
-
-Warning: unlink(): No such file or directory in %s on line %d
+Warning: tempnam() expects parameter 2 to be string, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d
+OK
 -- Iteration 8 --
-File name is => %s\di%s
-File permissions are => 100666
-File created in => directory specified
+OK
 -- Iteration 9 --
-File name is => %s\ph%s
-File permissions are => 100666
-File created in => directory specified
-
-*** Done ***
+OK
 
+*** Done. ***
index a0b9511b6364f6965117262eb17f4aebd7ee0c8e..69ab16c8966d350a95da33c0d02696e1d7501547 100644 (file)
@@ -108,7 +108,7 @@ File created in => directory specified
 Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d
 -- File is not created --
 
-Warning: unlink(): No such file or directory in %s on line %d
+Warning: unlink(): %s in %s on line %d
 -- Iteration 8 --
 File name is => %s/dir%s
 File permissions are => 100600
index 5096934e039cb44df2ebdea46078fa76c9fe5b57..34e352a497bfe720ee12326497b3f5ebefa8967e 100644 (file)
@@ -17,50 +17,47 @@ if(substr(PHP_OS, 0, 3) != "WIN")
 echo "*** Testing tempnam() with invalid/non-existing directory names ***\n";
 /* An array of names, which will be passed as a dir name */ 
 $names_arr = array(
-  /* Invalid args */ 
-  -1,
-  TRUE,
-  FALSE,
-  NULL,
-  "",
-  " ",
-  "\0",
-  array(),
-
-  /* Non-existing dirs */
-  "/no/such/file/dir", 
-  "php"
+       /* Invalid args */ 
+       -1,
+       TRUE,
+       FALSE,
+       NULL,
+       "",
+       " ",
+       "\0",
+       array(),
 
+       /* Non-existing dirs */
+       "/no/such/file/dir", 
+       "php"
 );
 
 for( $i=0; $i<count($names_arr); $i++ ) {
-  echo "-- Iteration $i --\n";
-  $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp");
+       echo "-- Iteration $i --\n";
+       $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp");
+
+       if( file_exists($file_name) ){
+
+               echo "File name is => ";
+               print($file_name);
+               echo "\n";
 
-  if( file_exists($file_name) ){
+               echo "File permissions are => ";
+               printf("%o", fileperms($file_name) );
+               echo "\n";
 
-    echo "File name is => ";
-    print($file_name);
-    echo "\n";
+               echo "File created in => ";
+               $file_dir = dirname($file_name);
+               if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) {
+                       echo "temp dir\n";
+               } else {
+                       echo "unknown location\n";
+               }
+       } else {
+               echo "-- File is not created --\n";
+       }
 
-    echo "File permissions are => ";
-    printf("%o", fileperms($file_name) );
-    echo "\n";
-    
-    echo "File created in => ";
-    $file_dir = dirname($file_name);
-    if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) {
-       echo "temp dir\n";
-    }
-    else {
-       echo "unknown location\n";
-    }                
-  }
-  else { 
-    echo "-- File is not created --\n";
-  }
-  unlink($file_name);
+       unlink($file_name);
 }
 
 echo "\n*** Done ***\n";
@@ -100,7 +97,7 @@ File created in => temp dir
 Warning: tempnam() expects parameter 1 to be string, array given in %s on line %d
 -- File is not created --
 
-Warning: unlink(): No such file or directory in %s on line %d
+Warning: unlink(): %s in %s on line %d
 -- Iteration 8 --
 File name is => %s%et%s
 File permissions are => 100666
index 0e314dabe3c0c613f06b3486df682ebedad78cbb..18d074d28d491a2b4b0ce64461bae10624133190 100644 (file)
@@ -102,7 +102,7 @@ File created in => temp dir
 Warning: tempnam() expects parameter 1 to be string, array given in %s on line %d
 -- File is not created --
 
-Warning: unlink(): No such file or directory in %s on line %d
+Warning: unlink(): %s in %s on line %d
 -- Iteration 8 --
 File name is => %s%etempnam_variation3.tmp%s
 File permissions are => 100600
index 2c913aeb5793132f75b9acae11816d08986a71f4..e55f6ed5cd48de89b94d6feb6c310a69904535d5 100644 (file)
@@ -77,15 +77,15 @@ bool(true)
 
 -- Testing unlink() on invalid arguments --
 
-Warning: unlink(): No such file or directory in %s on line %d
+Warning: unlink(): %s in %s on line %d
 bool(false)
 bool(false)
 
-Warning: unlink(): No such file or directory in %s on line %d
+Warning: unlink(): %s in %s on line %d
 bool(false)
 bool(false)
 
-Warning: unlink(): No such file or directory in %s on line %d
+Warning: unlink(): %s in %s on line %d
 bool(false)
 bool(false)
 
index b30636d205e8a2cac6fc3ce7d8f43fe7337340f3..01a8efbf5c941bea149a9615382aed89af16a7cc 100644 (file)
@@ -101,7 +101,7 @@ bool(false)
 value:
 int(0)
 ptrparam:
-int(8192)
+int(%d)
 $option === 3 === 3:
 bool(true)
 $value === 0 === 0:
index 2a1adeb0a4ed04b68dbe934050f0111bf9e360ef..c4276014af7b7d461215d47bf2aef36ae3a116b3 100644 (file)
@@ -118,7 +118,7 @@ function create_dir($name, $perms) {
 
 function create_file($name, $perms) {
        if (empty($name)) {
-               echo "create_dir: Empty name is not allowed\n";
+               echo "create_file: Empty name is not allowed\n";
                return;
        }
 
index fd365113dc61448bfbc14f1101f4b5294f2caf55..6c88c6319c3ffd10ccc84403f7fe8209d44311aa 100644 (file)
@@ -19,7 +19,7 @@ if (count($output) == 0) {
 <?php\r
 $old_dir = __DIR__;\r
 $dirname = __DIR__ . "\\mnt\\test\\directory";\r
-exec("mkdir " . $dirname, $output, $ret_val);\r
+mkdir($dirname, 0700, true);\r
 chdir(__DIR__ . "\\mnt\\test");\r
 $drive = substr(__DIR__, 0, 2);\r
 $pathwithoutdrive = substr(__DIR__, 2);\r
@@ -36,6 +36,7 @@ var_dump(is_dir("$fullpath"));
 var_dump(is_readable("mklink_junction"));\r
 var_dump(is_writeable("$fullpath"));\r
 chdir($old_dir);\r
+\r
 rmdir(__DIR__ . "\\mnt\\test\\directory");\r
 rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");\r
 rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");\r
@@ -51,4 +52,4 @@ bool(true)
 bool(true)\r
 bool(true)\r
 bool(true)\r
-bool(true)
+bool(true)\r
index a8cf48d3a88fd3f213eb1e71b278381433571d65..7beed16916c7066a465bdcc735335ffc23ea74a0 100644 (file)
@@ -9,11 +9,11 @@ Venkat Raman Don (don.raman@microsoft.com)
 if(substr(PHP_OS, 0, 3) != 'WIN' ) {\r
     die('skip windows only test');\r
 }\r
-$cmd = "mklink.exe /?";\r
-$ret = @exec($cmd, $output, $return_val);\r
-if (count($output) == 0) {\r
-    die("mklink.exe not found in PATH");\r
+$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);\r
+if (strpos($ret, 'privilege')) {\r
+       die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');\r
 }\r
+unlink('mklink bug48746_tmp.lnk');\r
 ?>\r
 --FILE--\r
 <?php\r
index ebc31ea59815a659f7b8b1274d64bc6599dd1735..a0dcbdc0265a39f44bd9ac5ba672859247614091 100644 (file)
@@ -7,13 +7,13 @@ Venkat Raman Don (don.raman@microsoft.com)
 --SKIPIF--\r
 <?php\r
 if(substr(PHP_OS, 0, 3) != 'WIN' ) {\r
-    die('skip windows only test');\r
+       die('skip windows only test');\r
 }\r
-$cmd = "junction.exe /?";\r
-$ret = @exec($cmd, $output, $return_val);\r
-if (count($output) == 0) {\r
-    die("junction.exe not found in PATH");\r
+$ret = exec('junction /? 2>&1', $out);\r
+if (strpos($out[0], 'recognized')) {\r
+       die('skip. junction.exe not found in PATH.');\r
 }\r
+\r
 ?>\r
 --FILE--\r
 <?php\r