]> granicus.if.org Git - php/commitdiff
- add -win32 versions and skipif
authorPierre Joye <pajoye@php.net>
Fri, 16 Sep 2011 10:45:04 +0000 (10:45 +0000)
committerPierre Joye <pajoye@php.net>
Fri, 16 Sep 2011 10:45:04 +0000 (10:45 +0000)
27 files changed:
ext/standard/tests/dir/dir_variation1-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/dir_variation1.phpt
ext/standard/tests/dir/dir_variation5-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/dir_variation5.phpt
ext/standard/tests/dir/dir_variation6-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/dir_variation6.phpt
ext/standard/tests/dir/dir_variation8-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/dir_variation8.phpt
ext/standard/tests/dir/dir_variation9-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/dir_variation9.phpt
ext/standard/tests/dir/opendir_error2-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/opendir_error2.phpt
ext/standard/tests/dir/opendir_variation1-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/opendir_variation1.phpt
ext/standard/tests/dir/opendir_variation6-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/opendir_variation6.phpt
ext/standard/tests/dir/scandir_error2-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/scandir_error2.phpt
ext/standard/tests/dir/scandir_variation1-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/scandir_variation1.phpt
ext/standard/tests/dir/scandir_variation6-win32.phpt [new file with mode: 0644]
ext/standard/tests/dir/scandir_variation6.phpt
ext/standard/tests/file/file_get_contents_variation8-win32.phpt
ext/standard/tests/file/file_get_contents_variation8.phpt
ext/standard/tests/file/popen_pclose_error-win32.phpt
ext/standard/tests/file/rename_variation13-win32.phpt
ext/standard/tests/file/tempnam_variation7-win32.phpt

diff --git a/ext/standard/tests/dir/dir_variation1-win32.phpt b/ext/standard/tests/dir/dir_variation1-win32.phpt
new file mode 100644 (file)
index 0000000..1f7f4a2
--- /dev/null
@@ -0,0 +1,170 @@
+--TEST--
+Test dir() function : usage variations - unexpected value for 'dir' argument
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* 
+ * Prototype  : object dir(string $directory[, resource $context])
+ * Description: Directory class with properties, handle and class and methods read, rewind and close
+ * Source code: ext/standard/dir.c
+ */
+
+/*
+ * Passing non string values to 'directory' argument of dir() and see
+ * that the function outputs proper warning messages wherever expected.
+ */
+
+echo "*** Testing dir() : unexpected values for \$directory argument ***\n";
+
+// get an unset variable
+$unset_var = 10;
+unset($unset_var);
+
+class A
+{
+  public $var;
+  public function init() {
+    $this->var = 10;
+  }
+}
+
+// get a resource variable
+$fp = fopen(__FILE__, "r"); // get a file handle 
+$dfp = opendir( dirname(__FILE__) ); // get a dir handle
+
+// unexpected values to be passed to $directory argument
+$unexpected_values = array (
+
+       // array data
+/*1*/  array(),
+       array(0),
+       array(1),
+       array(1, 2),
+       array('color' => 'red', 'item' => 'pen'),
+
+       // null data
+/*6*/  NULL,
+       null,
+
+       // boolean data
+/*8*/  true,
+       false,
+       TRUE,
+       FALSE,
+
+       // empty data
+/*12*/ "",
+       '',
+
+       // undefined data
+/*14*/ @$undefined_var,
+
+       // unset data
+/*15*/ @$unset_var,
+
+       // resource variable(dir and file handle)
+/*16*/ $fp,
+       $dfp,
+
+       // object data
+/*18*/ new A()
+);
+
+// loop through various elements of $unexpected_values to check the behavior of dir()
+$iterator = 1;
+foreach( $unexpected_values as $unexpected_value ) {
+  echo "\n-- Iteration $iterator --\n";
+  var_dump( dir($unexpected_value) );
+  $iterator++;
+}
+
+fclose($fp);
+closedir($dfp);
+echo "Done";
+?>
+--EXPECTF--
+*** Testing dir() : unexpected values for $directory argument ***
+
+-- Iteration 1 --
+
+Warning: dir() expects parameter 1 to be string, array given in %s on line %d
+NULL
+
+-- Iteration 2 --
+
+Warning: dir() expects parameter 1 to be string, array given in %s on line %d
+NULL
+
+-- Iteration 3 --
+
+Warning: dir() expects parameter 1 to be string, array given in %s on line %d
+NULL
+
+-- Iteration 4 --
+
+Warning: dir() expects parameter 1 to be string, array given in %s on line %d
+NULL
+
+-- Iteration 5 --
+
+Warning: dir() expects parameter 1 to be string, array given in %s on line %d
+NULL
+
+-- Iteration 6 --
+bool(false)
+
+-- Iteration 7 --
+bool(false)
+
+-- Iteration 8 --
+
+Warning: dir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: dir(1): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 9 --
+bool(false)
+
+-- Iteration 10 --
+
+Warning: dir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: dir(1): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 11 --
+bool(false)
+
+-- Iteration 12 --
+bool(false)
+
+-- Iteration 13 --
+bool(false)
+
+-- Iteration 14 --
+bool(false)
+
+-- Iteration 15 --
+bool(false)
+
+-- Iteration 16 --
+
+Warning: dir() expects parameter 1 to be string, resource given in %s on line %d
+NULL
+
+-- Iteration 17 --
+
+Warning: dir() expects parameter 1 to be string, resource given in %s on line %d
+NULL
+
+-- Iteration 18 --
+
+Warning: dir() expects parameter 1 to be string, object given in %s on line %d
+NULL
+Done
\ No newline at end of file
index ad912c008fd3ccd97be6eaa6818f8b67398bd80d..abb471950471e7259029ad317133a92d603b53bc 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test dir() function : usage variations - unexpected value for 'dir' argument
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* 
diff --git a/ext/standard/tests/dir/dir_variation5-win32.phpt b/ext/standard/tests/dir/dir_variation5-win32.phpt
new file mode 100644 (file)
index 0000000..e70b9d3
--- /dev/null
@@ -0,0 +1,37 @@
+--TEST--
+Test dir() function : usage variations - open a file instead of directory
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* 
+ * Prototype  : object dir(string $directory[, resource $context])
+ * Description: Directory class with properties, handle and class and methods read, rewind and close
+ * Source code: ext/standard/dir.c
+ */
+
+/*
+ * Passing a file as argument to dir() function instead of a directory 
+ * and checking if proper warning message is generated.
+ */
+
+echo "*** Testing dir() : open a file instead of a directory ***\n";
+
+// open the file instead of directory
+$d = dir(__FILE__);
+var_dump( $d );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing dir() : open a file instead of a directory ***
+
+Warning: dir(%s): The directory name is invalid. (code: %d) in %s on line %d
+
+Warning: dir(%s): failed to open dir: %s in %s on line %d
+bool(false)
+Done
index 2399c634c5479137010ca868b8cf5200886387cc..c7450eafc0e27a91fe567eaa7605719d0ac9cedf 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test dir() function : usage variations - open a file instead of directory
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* 
diff --git a/ext/standard/tests/dir/dir_variation6-win32.phpt b/ext/standard/tests/dir/dir_variation6-win32.phpt
new file mode 100644 (file)
index 0000000..e0e4749
--- /dev/null
@@ -0,0 +1,61 @@
+--TEST--
+Test dir() function : usage variations - non-existent directory
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* 
+ * Prototype  : object dir(string $directory[, resource $context])
+ * Description: Directory class with properties, handle and class and methods read, rewind and close
+ * Source code: ext/standard/dir.c
+ */
+
+/*
+ * Passing a non-existent directory as argument to dir() function
+ * and checking to see if proper warning message is output.
+ */
+echo "*** Testing dir() : open a non-existent directory ***\n";
+
+// create the temporary directory
+$file_path = dirname(__FILE__);
+$dir_path = $file_path."/dir_variation6";
+@mkdir($dir_path);
+
+// open existent directory
+$d = dir($dir_path);
+$d->close(); //close the dir
+
+// remove directory and try to open the same(non-existent) directory again
+rmdir($dir_path);
+clearstatcache();
+
+echo "-- opening previously removed directory --\n";
+var_dump( dir($dir_path) );
+
+// point to a non-existent directory
+$non_existent_dir = $file_path."/non_existent_dir";
+echo "-- opening non-existent directory --\n";
+$d = dir($non_existent_dir);
+var_dump( $d );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing dir() : open a non-existent directory ***
+-- opening previously removed directory --
+
+Warning: dir(%s): The system cannot find the file specified. (code: %d) in %s on line %d
+
+Warning: dir(%s): failed to open dir: %s in %s on line %d
+bool(false)
+-- opening non-existent directory --
+
+Warning: dir(%s): The system cannot find the file specified. (code: %d) in %s on line %d
+
+Warning: dir(%s): failed to open dir: %s in %s on line %d
+bool(false)
+Done
index e42057ed1541921559bbfb672def9086b408ac34..71cbf1fa17eaf9791fa57ca64378a4bfe2ac6fa2 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test dir() function : usage variations - non-existent directory
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* 
diff --git a/ext/standard/tests/dir/dir_variation8-win32.phpt b/ext/standard/tests/dir/dir_variation8-win32.phpt
new file mode 100644 (file)
index 0000000..2202fb0
--- /dev/null
@@ -0,0 +1,68 @@
+--TEST--
+Test dir() function : usage variations - checking with wildcard characters
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* 
+ * Prototype  : object dir(string $directory[, resource $context])
+ * Description: Directory class with properties, handle and class and methods read, rewind and close
+ * Source code: ext/standard/dir.c
+ */
+
+/* 
+ * Create more than one temporary directory & subdirectory and check if dir() function can open 
+ * those directories when wildcard characters are used to refer to them.
+ */
+
+echo "*** Testing dir() : checking with wildcard characters ***\n";
+
+// create the temporary directories
+$file_path = dirname(__FILE__);
+$dir_path = $file_path."/dir_variation81";
+$sub_dir_path = $dir_path."/sub_dir1";
+
+@mkdir($dir_path1);
+@mkdir($sub_dir_path);
+
+/* with different wildcard characters */
+
+echo "-- wildcard = '*' --\n"; 
+var_dump( dir($file_path."/dir_var*") );
+var_dump( dir($file_path."/*") );
+
+echo "-- wildcard = '?' --\n";
+var_dump( dir($dir_path."/sub_dir?") );
+var_dump( dir($dir_path."/sub?dir1") );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing dir() : checking with wildcard characters ***
+-- wildcard = '*' --
+
+Warning: dir(%s/dir_var*,%s/dir_var*): No such file or directory in %s on line %d
+
+Warning: dir(%s/dir_var*): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(%s/*,%s/*): No such file or directory in %s on line %d
+
+Warning: dir(%s/*): failed to open dir: %s in %s on line %d
+bool(false)
+-- wildcard = '?' --
+
+Warning: dir(%s/dir_variation81/sub_dir?,%s/dir_variation81/sub_dir?): No such file or directory in %s on line %d
+
+Warning: dir(%s/dir_variation81/sub_dir?): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(%s/dir_variation81/sub?dir1,%s/dir_variation81/sub?dir1): No such file or directory in %s on line %d
+
+Warning: dir(%s/dir_variation81/sub?dir1): failed to open dir: %s in %s on line %d
+bool(false)
+Done
index a0b74a3f61fafd0f1ad898b706ab850124057a01..5ecf449923063645bfbc0e6d34556b03f17ebcf3 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test dir() function : usage variations - checking with wildcard characters
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* 
diff --git a/ext/standard/tests/dir/dir_variation9-win32.phpt b/ext/standard/tests/dir/dir_variation9-win32.phpt
new file mode 100644 (file)
index 0000000..32b0bd9
--- /dev/null
@@ -0,0 +1,125 @@
+--TEST--
+Test dir() function : usage variations - relative valid and invalid paths
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* 
+ * Prototype  : object dir(string $directory[, resource $context])
+ * Description: Directory class with properties, handle and class and methods read, rewind and close
+ * Source code: ext/standard/dir.c
+ */
+
+/* 
+ * Checking the behavior of dir() function by passing directories which
+ * have valid and invalid relative path.
+ */
+
+echo "*** Testing dir() : checking with valid and invalid paths ***\n";
+
+/* create the temporary directories */
+
+$file_path = dirname(__FILE__);
+
+// directory dir_variation91 with one sub-directory sub_dir11 and sub-sub-directory sub_dir111
+$dir_path1 = $file_path."/dir_variation91";
+$sub_dir11 = $dir_path1."/sub_dir11";
+$sub_dir111 = $sub_dir11."/sub_dir111";
+
+// directory dir_variation92 with one sub-directory sub_dir21
+$dir_path2 = $file_path."/dir_variation92";
+$sub_dir21 = $dir_path2."/sub_dir21";
+
+@mkdir($dir_path1);
+@mkdir($dir_path2);
+@mkdir($sub_dir11);
+@mkdir($sub_dir111);
+@mkdir($sub_dir21);
+
+// open the directory with valid paths
+echo "\n-- With valid paths --\n";
+var_dump( dir("$dir_path1/sub_dir11/sub_dir111/..") );
+var_dump( dir("$dir_path2/sub_dir21/../../dir_variation91") );
+var_dump( dir("$dir_path2/sub_dir21/../../dir_variation91/sub_dir11/..") );
+var_dump( dir("$dir_path1/sub_dir11/sub_dir111/../../../dir_variation92/sub_dir21/..") );
+
+// open the directory with invalid path
+echo "\n-- With invalid paths --\n";
+var_dump( dir("$dir_path1/sub_dir12/sub_dir111/..") );
+var_dump( dir("$dir_path2/sub_dir21/../dir_variation91") );
+var_dump( dir("$dir_path2/sub_dir21/../../dir_variation91/sub_dir12/..") );
+var_dump( dir("$dir_path1/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..") );
+
+echo "Done";
+?>
+--CLEAN--
+<?php
+$file_path = dirname(__FILE__);
+
+$dir_path1 = $file_path."/dir_variation91";
+$sub_dir11 = $dir_path1."/sub_dir11";
+$sub_dir111 = $sub_dir11."/sub_dir111";
+$dir_path2 = $file_path."/dir_variation92";
+$sub_dir21 = $dir_path2."/sub_dir21";
+
+rmdir($sub_dir21);
+rmdir($sub_dir111);
+rmdir($sub_dir11);
+rmdir($dir_path1);
+rmdir($dir_path2);
+?>
+--EXPECTF--
+*** Testing dir() : checking with valid and invalid paths ***
+
+-- With valid paths --
+object(Directory)#%d (2) {
+  ["path"]=>
+  string(%d) "%s/dir_variation91/sub_dir11/sub_dir111/.."
+  ["handle"]=>
+  resource(%d) of type (stream)
+}
+object(Directory)#%d (2) {
+  ["path"]=>
+  string(%d) "%s/dir_variation92/sub_dir21/../../dir_variation91"
+  ["handle"]=>
+  resource(%d) of type (stream)
+}
+object(Directory)#%d (2) {
+  ["path"]=>
+  string(%d) "%s/dir_variation92/sub_dir21/../../dir_variation91/sub_dir11/.."
+  ["handle"]=>
+  resource(%d) of type (stream)
+}
+object(Directory)#%d (2) {
+  ["path"]=>
+  string(%d) "%s/dir_variation91/sub_dir11/sub_dir111/../../../dir_variation92/sub_dir21/.."
+  ["handle"]=>
+  resource(%d) of type (stream)
+}
+
+-- With invalid paths --
+
+Warning: dir(%sdir_variation91/sub_dir12/sub_dir111/..,%sdir_variation91/sub_dir12/sub_dir111/..): The system cannot find the path specified. (code: 3) in %sdir_variation9-win32.php on line %d
+
+Warning: dir(%s/dir_variation91/sub_dir12/sub_dir111/..): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(%sdir_variation92/sub_dir21/../dir_variation91,%sdir_variation92/sub_dir21/../dir_variation91): The system cannot find the file specified. (code: 2) in %sdir_variation9-win32.php on line %d
+
+Warning: dir(%s/dir_variation92/sub_dir21/../dir_variation91): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(%sdir_variation92/sub_dir21/../../dir_variation91/sub_dir12/..,%sdir_variation92/sub_dir21/../../dir_variation91/sub_dir12/..): The system cannot find the file specified. (code: 2) in %sdir_variation9-win32.php on line %d
+
+Warning: dir(%s/dir_variation92/sub_dir21/../../dir_variation91/sub_dir12/..): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(%sdir_variation91/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..,%sdir_variation91/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..): The system cannot find the path specified. (code: 3) in %sdir_variation9-win32.php on line %d
+
+Warning: dir(%s/dir_variation91/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..): failed to open dir: %s in %s on line %d
+bool(false)
+Done
index 22f3d5baabf03e3f0798a074915fcbaa710516cc..458d0b896f6d2bf91e0ed2c73d6ab39e6bd85157 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test dir() function : usage variations - relative valid and invalid paths
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* 
diff --git a/ext/standard/tests/dir/opendir_error2-win32.phpt b/ext/standard/tests/dir/opendir_error2-win32.phpt
new file mode 100644 (file)
index 0000000..c3ecd35
--- /dev/null
@@ -0,0 +1,47 @@
+--TEST--
+Test opendir() function : error conditions - Non-existent directory
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* Prototype  : mixed opendir(string $path[, resource $context])
+ * Description: Open a directory and return a dir_handle 
+ * Source code: ext/standard/dir.c
+ */
+
+/*
+ * Pass a non-existent directory as $path argument to opendir() to test behaviour
+ */
+
+echo "*** Testing opendir() : error conditions ***\n";
+
+echo "\n-- Pass a non-existent absolute path: --\n";
+$path = dirname(__FILE__) . "/idonotexist";
+var_dump(opendir($path));
+
+echo "\n-- Pass a non-existent relative path: --\n";
+chdir(dirname(__FILE__));
+var_dump(opendir('idonotexist'));
+?>
+===DONE===
+--EXPECTF--
+*** Testing opendir() : error conditions ***
+
+-- Pass a non-existent absolute path: --
+
+Warning: opendir(%s/idonotexist,%s/idonotexist): The system cannot find the file specified. (code: %d) in %s on line %d
+
+Warning: opendir(%s/idonotexist): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Pass a non-existent relative path: --
+
+Warning: opendir(idonotexist,idonotexist): The system cannot find the file specified. (code: %d) in %s on line %d
+
+Warning: opendir(idonotexist): failed to open dir: %s in %s on line %d
+bool(false)
+===DONE===
index 0762be2ad3095bb2449c90efb00588ade8bf8869..1c724097b09429e20a7c9c71d7f4080c5f461d8f 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test opendir() function : error conditions - Non-existent directory
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* Prototype  : mixed opendir(string $path[, resource $context])
diff --git a/ext/standard/tests/dir/opendir_variation1-win32.phpt b/ext/standard/tests/dir/opendir_variation1-win32.phpt
new file mode 100644 (file)
index 0000000..9a75a5b
--- /dev/null
@@ -0,0 +1,248 @@
+--TEST--
+Test opendir() function : usage variations - different data types as $path arg
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* Prototype  : mixed opendir(string $path[, resource $context])
+ * Description: Open a directory and return a dir_handle 
+ * Source code: ext/standard/dir.c
+ */
+
+/*
+ * Pass different data types as $path argument to opendir() to test behaviour
+ * Where possible, an existing directory has been entered as a string value
+ */
+
+echo "*** Testing opendir() : usage variations ***\n";
+
+// create directory to be passed as string value where possible
+$path = dirname(__FILE__) . "/opendir_variation1";
+mkdir($path);
+
+//get an unset variable
+$unset_var = 10;
+unset ($unset_var);
+
+// get a class
+class classA {
+       
+       var $path;
+       function __construct($path) {
+               $this->path = $path;
+       }
+       public function __toString() {
+               return $this->path;
+       }
+}
+
+// heredoc string
+$heredoc = <<<EOT
+$path
+EOT;
+
+// get a resource variable
+$fp = fopen(__FILE__, "r");
+
+// unexpected values to be passed to $path argument
+$inputs = array(
+
+       // int data
+/*1*/  0,
+       1,
+       12345,
+       -2345,
+
+       // float data
+/*5*/  10.5,
+       -10.5,
+       12.3456789000e10,
+       12.3456789000E-10,
+       .5,
+
+       // null data
+/*10*/ NULL,
+       null,
+
+       // boolean data
+/*12*/ true,
+       false,
+       TRUE,
+       FALSE,
+       
+       // empty data
+/*16*/ "",
+       '',
+       array(),
+
+       // string data
+/*19*/ "$path",
+       'string',
+       $heredoc,
+       
+       // object data
+/*22*/ new classA($path),
+
+       // undefined data
+/*23*/ @$undefined_var,
+
+       // unset data
+/*24*/ @$unset_var,
+
+       // resource variable
+/*25*/ $fp
+);
+
+// loop through each element of $inputs to check the behavior of opendir()
+$iterator = 1;
+foreach($inputs as $input) {
+       echo "\n-- Iteration $iterator --\n";
+       var_dump( $dh = opendir($input) );
+       if ($dh) {
+               closedir($dh);
+       }
+       $iterator++;
+};
+
+fclose($fp);
+?>
+===DONE===
+--CLEAN--
+<?php
+$path = dirname(__FILE__) . "/opendir_variation1";
+rmdir($path);
+?>
+--EXPECTF--
+*** Testing opendir() : usage variations ***
+
+-- Iteration 1 --
+
+Warning: opendir(0,0): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(0): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 2 --
+
+Warning: opendir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(1): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 3 --
+
+Warning: opendir(12345,12345): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(12345): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 4 --
+
+Warning: opendir(-2345,-2345): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(-2345): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 5 --
+
+Warning: opendir(10.5,10.5): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(10.5): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 6 --
+
+Warning: opendir(-10.5,-10.5): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(-10.5): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 7 --
+
+Warning: opendir(123456789000,123456789000): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(123456789000): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 8 --
+
+Warning: opendir(1.23456789E-9,1.23456789E-9): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(1.23456789E-9): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 9 --
+
+Warning: opendir(0.5,0.5): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(0.5): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 10 --
+bool(false)
+
+-- Iteration 11 --
+bool(false)
+
+-- Iteration 12 --
+
+Warning: opendir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(1): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 13 --
+bool(false)
+
+-- Iteration 14 --
+
+Warning: opendir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(1): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 15 --
+bool(false)
+
+-- Iteration 16 --
+bool(false)
+
+-- Iteration 17 --
+bool(false)
+
+-- Iteration 18 --
+
+Warning: opendir() expects parameter 1 to be string, array given in %s on line %d
+NULL
+
+-- Iteration 19 --
+resource(%d) of type (stream)
+
+-- Iteration 20 --
+
+Warning: opendir(string,string): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: opendir(string): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Iteration 21 --
+resource(%d) of type (stream)
+
+-- Iteration 22 --
+resource(%d) of type (stream)
+
+-- Iteration 23 --
+bool(false)
+
+-- Iteration 24 --
+bool(false)
+
+-- Iteration 25 --
+
+Warning: opendir() expects parameter 1 to be string, resource given in %s on line %d
+NULL
+===DONE===
index dc10356f565ee0cd1c91bd4836d3029d26110154..8d195e1e62ad727ac7363f42f8cb56c1adad368e 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test opendir() function : usage variations - different data types as $path arg
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* Prototype  : mixed opendir(string $path[, resource $context])
diff --git a/ext/standard/tests/dir/opendir_variation6-win32.phpt b/ext/standard/tests/dir/opendir_variation6-win32.phpt
new file mode 100644 (file)
index 0000000..b5a4aa4
--- /dev/null
@@ -0,0 +1,75 @@
+--TEST--
+Test opendir() function : usage variations - Different wildcards
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* Prototype  : mixed opendir(string $path[, resource $context])
+ * Description: Open a directory and return a dir_handle 
+ * Source code: ext/standard/dir.c
+ */
+
+/*
+ * Pass paths containing wildcards to test if opendir() recognises them
+ */
+
+echo "*** Testing opendir() : usage variations ***\n";
+// create the temporary directories
+$file_path = dirname(__FILE__);
+$dir_path = $file_path . "/opendir_variation6";
+$sub_dir_path = $dir_path . "/sub_dir1";
+
+mkdir($dir_path);
+mkdir($sub_dir_path);
+
+// with different wildcard characters
+
+echo "\n-- Wildcard = '*' --\n"; 
+var_dump( opendir($file_path . "/opendir_var*") );
+var_dump( opendir($file_path . "/*") );
+
+echo "\n-- Wildcard = '?' --\n";
+var_dump( opendir($dir_path . "/sub_dir?") );
+var_dump( opendir($dir_path . "/sub?dir1") );
+
+?>
+===DONE===
+--CLEAN--
+<?php
+$dir_path = dirname(__FILE__) . "/opendir_variation6";
+$sub_dir_path = $dir_path . "/sub_dir1";
+
+rmdir($sub_dir_path);
+rmdir($dir_path);
+?>
+--EXPECTF--
+*** Testing opendir() : usage variations ***
+
+-- Wildcard = '*' --
+
+Warning: opendir(%s/opendir_var*,%s/opendir_var*): No such file or directory in %s on line %d
+
+Warning: opendir(%s/opendir_var*): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: opendir(%s/*,%s/*): No such file or directory in %s on line %d
+
+Warning: opendir(%s/*): failed to open dir: %s in %s on line %d
+bool(false)
+
+-- Wildcard = '?' --
+
+Warning: opendir(%s/opendir_variation6/sub_dir?,%s/opendir_variation6/sub_dir?): No such file or directory in %s on line %d
+
+Warning: opendir(%s/opendir_variation6/sub_dir?): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: opendir(%s/opendir_variation6/sub?dir1,%s/opendir_variation6/sub?dir1): No such file or directory in %s on line %d
+
+Warning: opendir(%s/opendir_variation6/sub?dir1): failed to open dir: %s in %s on line %d
+bool(false)
+===DONE===
index 01e8225d59354aedcbe6cb4c733ecc87da891722..f3fc0bd6df901ed4a87530ac9613af6cc796d5a3 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test opendir() function : usage variations - Different wildcards
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* Prototype  : mixed opendir(string $path[, resource $context])
diff --git a/ext/standard/tests/dir/scandir_error2-win32.phpt b/ext/standard/tests/dir/scandir_error2-win32.phpt
new file mode 100644 (file)
index 0000000..9920be7
--- /dev/null
@@ -0,0 +1,51 @@
+--TEST--
+Test scandir() function : error conditions - Non-existent directory
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* Prototype  : array scandir(string $dir [, int $sorting_order [, resource $context]])
+ * Description: List files & directories inside the specified path 
+ * Source code: ext/standard/dir.c
+ */
+
+/*
+ * Pass a directory that does not exist to scandir() to test error messages
+ */
+
+echo "*** Testing scandir() : error conditions ***\n";
+
+$directory = dirname(__FILE__) . '/idonotexist';
+
+echo "\n-- Pass scandir() an absolute path that does not exist --\n";
+var_dump(scandir($directory));
+
+echo "\n-- Pass scandir() a relative path that does not exist --\n";
+var_dump(scandir('/idonotexist'));
+?>
+===DONE===
+--EXPECTF--
+*** Testing scandir() : error conditions ***
+
+-- Pass scandir() an absolute path that does not exist --
+
+Warning: scandir(%s/idonotexist,%s/idonotexist): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(%s/idonotexist): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Pass scandir() a relative path that does not exist --
+
+Warning: scandir(/idonotexist,/idonotexist): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(/idonotexist): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+===DONE===
index 1e99a578ac6ce926b8945873fd956730fb6cfa73..b5bfc28c8ef665d12b65bb203d1059a2d9cab14d 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test scandir() function : error conditions - Non-existent directory
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* Prototype  : array scandir(string $dir [, int $sorting_order [, resource $context]])
diff --git a/ext/standard/tests/dir/scandir_variation1-win32.phpt b/ext/standard/tests/dir/scandir_variation1-win32.phpt
new file mode 100644 (file)
index 0000000..a2b5bd4
--- /dev/null
@@ -0,0 +1,289 @@
+--TEST--
+Test scandir() function : usage variations - different data types as $dir arg
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* Prototype  : array scandir(string $dir [, int $sorting_order [, resource $context]])
+ * Description: List files & directories inside the specified path 
+ * Source code: ext/standard/dir.c
+ */
+
+/*
+ * Pass different data types as $dir argument to test behaviour of scandir()
+ */
+
+echo "*** Testing scandir() : usage variations ***\n";
+
+//get an unset variable
+$unset_var = 10;
+unset ($unset_var);
+
+// get a class
+class classA
+{
+  public function __toString() {
+    return "Class A object";
+  }
+}
+
+// heredoc string
+$heredoc = <<<EOT
+hello world
+EOT;
+
+// get a resource variable
+$fp = fopen(__FILE__, "r");
+
+// unexpected values to be passed to $dir argument
+$inputs = array(
+
+       // int data
+/*1*/  0,
+       1,
+       12345,
+       -2345,
+
+       // float data
+/*5*/  10.5,
+       -10.5,
+       12.3456789000e10,
+       12.3456789000E-10,
+       .5,
+
+       // null data
+/*10*/ NULL,
+       null,
+
+       // boolean data
+/*12*/ true,
+       false,
+       TRUE,
+       FALSE,
+       
+       // empty data
+/*16*/ "",
+       '',
+       array(),
+
+       // string data
+/*19*/ "string",
+       'string',
+       $heredoc,
+       
+       // object data
+/*22*/ new classA(),
+
+       // undefined data
+/*23*/ @$undefined_var,
+
+       // unset data
+/*24*/ @$unset_var,
+
+       // resource variable
+/*25*/ $fp
+);
+
+// loop through each element of $inputs to check the behavior of scandir()
+$iterator = 1;
+foreach($inputs as $input) {
+  echo "\n-- Iteration $iterator --\n";
+  var_dump( scandir($input) );
+  $iterator++;
+};
+
+fclose($fp);
+?>
+===DONE===
+--EXPECTF--
+*** Testing scandir() : usage variations ***
+
+-- Iteration 1 --
+
+Warning: scandir(0,0): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(0): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 2 --
+
+Warning: scandir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(1): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 3 --
+
+Warning: scandir(12345,12345): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(12345): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 4 --
+
+Warning: scandir(-2345,-2345): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(-2345): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 5 --
+
+Warning: scandir(10.5,10.5): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(10.5): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 6 --
+
+Warning: scandir(-10.5,-10.5): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(-10.5): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 7 --
+
+Warning: scandir(123456789000,123456789000): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(123456789000): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 8 --
+
+Warning: scandir(1.23456789E-9,1.23456789E-9): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(1.23456789E-9): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 9 --
+
+Warning: scandir(0.5,0.5): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(0.5): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 10 --
+
+Warning: scandir(): Directory name cannot be empty in %s on line %d
+bool(false)
+
+-- Iteration 11 --
+
+Warning: scandir(): Directory name cannot be empty in %s on line %d
+bool(false)
+
+-- Iteration 12 --
+
+Warning: scandir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(1): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 13 --
+
+Warning: scandir(): Directory name cannot be empty in %s on line %d
+bool(false)
+
+-- Iteration 14 --
+
+Warning: scandir(1,1): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(1): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 15 --
+
+Warning: scandir(): Directory name cannot be empty in %s on line %d
+bool(false)
+
+-- Iteration 16 --
+
+Warning: scandir(): Directory name cannot be empty in %s on line %d
+bool(false)
+
+-- Iteration 17 --
+
+Warning: scandir(): Directory name cannot be empty in %s on line %d
+bool(false)
+
+-- Iteration 18 --
+
+Warning: scandir() expects parameter 1 to be a valid path, array given in %s on line %d
+NULL
+
+-- Iteration 19 --
+
+Warning: scandir(string,string): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(string): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 20 --
+
+Warning: scandir(string,string): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(string): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 21 --
+
+Warning: scandir(hello world,hello world): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(hello world): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 22 --
+
+Warning: scandir(Class A object,Class A object): The system cannot find the file specified. (code: 2) in %s on line %d
+
+Warning: scandir(Class A object): failed to open dir: No such file or directory in %sscandir_variation1-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Iteration 23 --
+
+Warning: scandir(): Directory name cannot be empty in %s on line %d
+bool(false)
+
+-- Iteration 24 --
+
+Warning: scandir(): Directory name cannot be empty in %s on line %d
+bool(false)
+
+-- Iteration 25 --
+
+Warning: scandir() expects parameter 1 to be a valid path, resource given in %s on line %d
+NULL
+===DONE===
index 0b35413adacc9439dc510e7ad93c39cb85e7278f..ccd5bb967a4d28dd9223d54b0126e1b460d12c43 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test scandir() function : usage variations - different data types as $dir arg
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* Prototype  : array scandir(string $dir [, int $sorting_order [, resource $context]])
diff --git a/ext/standard/tests/dir/scandir_variation6-win32.phpt b/ext/standard/tests/dir/scandir_variation6-win32.phpt
new file mode 100644 (file)
index 0000000..040dc78
--- /dev/null
@@ -0,0 +1,84 @@
+--TEST--
+Test scandir() function : usage variations - Wildcards in directory path
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
+?>
+--FILE--
+<?php
+/* Prototype  : array scandir(string $dir [, int $sorting_order [, resource $context]])
+ * Description: List files & directories inside the specified path 
+ * Source code: ext/standard/dir.c
+ */
+
+/*
+ * Pass a directory path using wildcards as $dir argument to test how scandir() behaves
+ */
+
+echo "*** Testing scandir() : usage variations ***\n";
+
+// create the temporary directories
+$file_path = dirname(__FILE__);
+$dir_path = $file_path . "/scandir_variation6";
+$sub_dir_path = $dir_path . "/sub_dir1";
+
+mkdir($dir_path);
+mkdir($sub_dir_path);
+
+// with different wildcard characters
+
+echo "\n-- Wildcard = '*' --\n"; 
+var_dump( scandir($file_path . "/scandir_var*") );
+var_dump( scandir($file_path . "/*") );
+
+echo "\n-- Wildcard = '?' --\n";
+var_dump( scandir($dir_path . "/sub_dir?") );
+var_dump( scandir($dir_path . "/sub?dir1") );
+
+?>
+===DONE===
+--CLEAN--
+<?php
+$dir_path = dirname(__FILE__) . "/scandir_variation6";
+$sub_dir_path = $dir_path . "/sub_dir1";
+
+rmdir($sub_dir_path);
+rmdir($dir_path);
+?>
+--EXPECTF--
+*** Testing scandir() : usage variations ***
+
+-- Wildcard = '*' --
+
+Warning: scandir(%s/scandir_var*,%s/scandir_var*): No such file or directory in %s on line %d
+
+Warning: scandir(%s/scandir_var*): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+Warning: scandir(%s/*,%s/*): No such file or directory in %s on line %d
+
+Warning: scandir(%s/*): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+-- Wildcard = '?' --
+
+Warning: scandir(%s/scandir_variation6/sub_dir?,%s/scandir_variation6/sub_dir?): No such file or directory in %s on line %d
+
+Warning: scandir(%s/scandir_variation6/sub_dir?): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+
+Warning: scandir(%s/scandir_variation6/sub?dir1,%s/scandir_variation6/sub?dir1): No such file or directory in %s on line %d
+
+Warning: scandir(%s/scandir_variation6/sub?dir1): failed to open dir: No such file or directory in %sscandir_variation6-win32.php on line %d
+
+Warning: scandir(): (errno %d): %s in %s on line %d
+bool(false)
+===DONE===
index 5cb595fe75cc3968fcc2fe4ca731d4c1de0102a6..754c6152908bf9478ca3bd8dfae40d87c51bf290 100644 (file)
@@ -1,5 +1,11 @@
 --TEST--
 Test scandir() function : usage variations - Wildcards in directory path
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
+?>
 --FILE--
 <?php
 /* Prototype  : array scandir(string $dir [, int $sorting_order [, resource $context]])
index 43d742a67c8a91b41daed3a6c4322bcfd5711002..bb62eb47fb1860f1409450b3d500be31b7dfc3c5 100644 (file)
@@ -4,8 +4,9 @@ Test file_get_contents() function : variation - obscure filenames
 Dave Kelsey <d_kelsey@uk.ibm.com>
 --SKIPIF--
 <?php
-if(substr(PHP_OS, 0, 3) != "WIN")
-  die("skip Only run on Windows");
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+  die("skip Valid only on Windows");
+}
 ?>
 --FILE--
 <?php
@@ -62,7 +63,7 @@ bool(false)
 
 -- Filename: NULL --
 
-Warning: file_get_contents(): Filename cannot be empty in %s on line %d
+Warning: file_get_contents(): Filename cannot be empty in %sfile_get_contents_variation8-win32.php on line %d
 bool(false)
 
 -- Filename: "" --
@@ -77,12 +78,12 @@ bool(false)
 
 -- Filename: \0 --
 
-Warning: file_get_contents(): Filename cannot be empty in %s on line %d
-bool(false)
+Warning: file_get_contents() expects parameter 1 to be a valid path, string given in %s on line %d
+NULL
 
 -- Filename: array() --
 
-Warning: file_get_contents() expects parameter 1 to be string, array given in %s on line %d
+Warning: file_get_contents() expects parameter 1 to be a valid path, array given in %s on line %d
 NULL
 
 -- Filename: /no/such/file/dir --
@@ -94,4 +95,4 @@ bool(false)
 
 Warning: file_get_contents(php/php): failed to open stream: No such file or directory in %s on line %d
 bool(false)
-===Done===
\ No newline at end of file
+===Done===
index 40efe26830478afdb8fc57d6888e1b22bd211bae..5b325b0e98460ccac2f1a2a8270391d86d43e720 100644 (file)
@@ -4,8 +4,9 @@ Test file_get_contents() function : variation - obscure filenames
 Dave Kelsey <d_kelsey@uk.ibm.com>
 --SKIPIF--
 <?php
-if(substr(PHP_OS, 0, 3) == "WIN")
-  die("skip Do not run on Windows");
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. Not valid for Windows');
+}
 ?>
 --FILE--
 <?php
index f81cd52605f10b53d3a359625795dab688c79f67..486f369c9a91b13f7bbd8b8b9986e200b5b757bb 100644 (file)
@@ -41,9 +41,9 @@ NULL
 
 Warning: popen() expects exactly 2 parameters, 1 given in %s on line %d
 NULL
-resource(%d) of type (stream)
-'abc.txt' is not recognized as an internal or external command,
-operable program or batch file.
+
+Warning: popen(abc.txt,rw): Invalid argument in %s on line %d
+bool(false)
 
 Warning: pclose() expects exactly 1 parameter, 0 given in %s on line %d
 bool(false)
@@ -54,4 +54,5 @@ bool(false)
 Warning: pclose() expects parameter 1 to be resource, integer given in %s on line %d
 bool(false)
 
---- Done ---
+--- Done ---'abc.txt' is not recognized as an internal or external command,
+operable program or batch file.
index a963b8e8898076f69106fcd943e3221dd8f44535..8e6cc2ed7aea4a011d3f0f0b5f2b8815fb83c6dd 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 2572f65d02de8c1c7f7e6df75397f61c2a808c4c..1f0d97acfe11f1cfe27a1e8751b47deff2df8a38 100644 (file)
@@ -13,7 +13,7 @@ if(substr(PHP_OS, 0, 3) != "WIN")
 
 /* Passing invalid/non-existing args for $dir, 
      hence the unique files will be created in temporary dir */
-
 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(
@@ -93,13 +93,13 @@ File created in => temp dir
 Warning: tempnam() expects parameter 1 to be a valid path, string given in %stempnam_variation7-win32.php on line %d
 -- File is not created --
 
-Warning: unlink(): Invalid argument in %stempnam_variation7-win32.php on line %d
+Warning: unlink(): Invalid argument in %s on line %d
 -- Iteration 7 --
 
 Warning: tempnam() expects parameter 1 to be a valid path, array given in %s on line %d
 -- File is not created --
 
-Warning: unlink(): Invalid argument in %stempnam_variation7-win32.php on line %d
+Warning: unlink(): Invalid argument in %s on line %d
 -- Iteration 8 --
 File name is => %s%et%s
 File permissions are => 100666