From: Ant Phillips Date: Tue, 25 Nov 2008 11:33:41 +0000 (+0000) Subject: File system tests: checked on PHP 5.2.6, 5.3 and 6.0 (Windows, Linux and Linux 64... X-Git-Tag: php-5.2.7RC5~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=701c5a64a425288b861c089b4e8787807e7bbba6;p=php File system tests: checked on PHP 5.2.6, 5.3 and 6.0 (Windows, Linux and Linux 64 bit). There seems to be an issue with trailing slashes on 5.2.7 RC1 which may cause some tests to fail... --- diff --git a/ext/standard/tests/file/001-win32.phpt b/ext/standard/tests/file/001-win32.phpt index 09ab2b7a1b..69e82ab897 100644 --- a/ext/standard/tests/file/001-win32.phpt +++ b/ext/standard/tests/file/001-win32.phpt @@ -10,7 +10,6 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { +--SKIPIF-- + +--FILE-- + "; + echo fileatime($filename)."\n"; + clearstatcache(); + echo "-- File modification time is => "; + echo filemtime($filename)."\n"; + clearstatcache(); + echo "-- inode change time is => "; + echo filectime($filename)."\n"; + clearstatcache(); + + +} + +echo "*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations ***\n"; +echo "\n*** testing file info ***"; +stat_fn(NULL); +stat_fn(false); +stat_fn(''); +stat_fn(' '); +stat_fn('|'); +echo "\n*** testing touch ***"; +var_dump(touch(NULL)); +var_dump(touch(false)); +var_dump(touch('')); + +//php generates permission denied, we generate No such file or dir. +var_dump(touch(' ')); +var_dump(touch('|')); + + +echo "Done"; +?> +--EXPECTF-- +*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations *** + +*** testing file info *** +-- File '' -- +-- File access time is => +-- File modification time is => +-- inode change time is => + +-- File '' -- +-- File access time is => +-- File modification time is => +-- inode change time is => + +-- File '' -- +-- File access time is => +-- File modification time is => +-- inode change time is => + +-- File ' ' -- +-- File access time is => +Warning: fileatime(): stat failed for in %s on line %d + +-- File modification time is => +Warning: filemtime(): stat failed for in %s on line %d + +-- inode change time is => +Warning: filectime(): stat failed for in %s on line %d + + +-- File '|' -- +-- File access time is => +Warning: fileatime(): stat failed for | in %s on line %d + +-- File modification time is => +Warning: filemtime(): stat failed for | in %s on line %d + +-- inode change time is => +Warning: filectime(): stat failed for | in %s on line %d + + +*** testing touch *** +Warning: touch(): Unable to create file because No such file or directory in %s on line %d +bool(false) + +Warning: touch(): Unable to create file because No such file or directory in %s on line %d +bool(false) + +Warning: touch(): Unable to create file because No such file or directory in %s on line %d +bool(false) + +Warning: touch(): Unable to create file because %s in %s on line %d +bool(false) + +Warning: touch(): Unable to create file | because %s in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/file/005_variation2.phpt b/ext/standard/tests/file/005_variation2.phpt new file mode 100644 index 0000000000..4d9942402b --- /dev/null +++ b/ext/standard/tests/file/005_variation2.phpt @@ -0,0 +1,113 @@ +--TEST-- +Test fileatime(), filemtime(), filectime() & touch() functions : usage variation +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + "; + echo fileatime($filename)."\n"; + clearstatcache(); + echo "-- File modification time is => "; + echo filemtime($filename)."\n"; + clearstatcache(); + echo "-- inode change time is => "; + echo filectime($filename)."\n"; + clearstatcache(); + + +} + +echo "*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations ***\n"; +echo "\n*** testing touch ***\n"; +var_dump(touch(NULL)); +var_dump(touch(false)); +var_dump(touch('')); +var_dump(touch(' ')); +var_dump(touch('|')); + +echo "\n*** testing file info ***"; +stat_fn(NULL); +stat_fn(false); +stat_fn(''); +stat_fn(' '); +stat_fn('|'); + +var_dump(unlink(' ')); +var_dump(unlink('|')); + +echo "Done"; +?> +--EXPECTF-- +*** Testing fileattime(), filemtime(), filectime() & touch() : usage variations *** + +*** testing touch *** + +Warning: touch(): Unable to create file because No such file or directory in %s on line %d +bool(false) + +Warning: touch(): Unable to create file because No such file or directory in %s on line %d +bool(false) + +Warning: touch(): Unable to create file because No such file or directory in %s on line %d +bool(false) +bool(true) +bool(true) + +*** testing file info *** +-- File '' -- +-- File access time is => +-- File modification time is => +-- inode change time is => + +-- File '' -- +-- File access time is => +-- File modification time is => +-- inode change time is => + +-- File '' -- +-- File access time is => +-- File modification time is => +-- inode change time is => + +-- File ' ' -- +-- File access time is => %d +-- File modification time is => %d +-- inode change time is => %d + +-- File '|' -- +-- File access time is => %d +-- File modification time is => %d +-- inode change time is => %d +bool(true) +bool(true) +Done diff --git a/ext/standard/tests/file/006_error.phpt b/ext/standard/tests/file/006_error.phpt index ac95ca5700..3cbacd5639 100644 --- a/ext/standard/tests/file/006_error.phpt +++ b/ext/standard/tests/file/006_error.phpt @@ -11,7 +11,7 @@ $fp = fopen($filename, 'w'); fclose($fp); if(fileowner($filename) == 0) { unlink ($filename); - die('skip cannot be run as root'); + die('skip...cannot be run as root\n'); } unlink($filename); @@ -68,18 +68,18 @@ unlink( dirname(__FILE__)."/006_error.tmp"); --EXPECTF-- *** Testing error conditions for fileperms(), chmod() *** -Warning: chmod(): %s in %s on line %d +Warning: chmod(): %s bool(false) -100%d44 +%d -Warning: chmod(): %s in %s on line %d +Warning: chmod(): %s bool(false) -40755 +%d -Warning: chmod(): No such file or directory in %s on line %d +Warning: chmod(): %s bool(false) -Warning: fileperms(): stat failed for /no/such/file/dir in %s on line %d +Warning: fileperms(): %s bool(false) diff --git a/ext/standard/tests/file/007_error.phpt b/ext/standard/tests/file/007_error.phpt index bf976093a2..d63a522619 100644 --- a/ext/standard/tests/file/007_error.phpt +++ b/ext/standard/tests/file/007_error.phpt @@ -74,7 +74,7 @@ bool(false) Warning: fopen() expects at least 2 parameters, 0 given in %s on line %d bool(false) -Warning: fclose(): 5 is not a valid stream resource in %s on line %d +Warning: fclose(): %d is not a valid stream resource in %s on line %d bool(false) Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d @@ -83,7 +83,7 @@ bool(false) Warning: Wrong parameter count for fclose() in %s on line %d NULL -Warning: feof(): 5 is not a valid stream resource in %s on line %d +Warning: feof(): %d is not a valid stream resource in %s on line %d bool(false) Warning: feof(): supplied argument is not a valid stream resource in %s on line %d diff --git a/ext/standard/tests/file/basename-win32.phpt b/ext/standard/tests/file/basename-win32.phpt new file mode 100644 index 0000000000..5fd0f9659f --- /dev/null +++ b/ext/standard/tests/file/basename-win32.phpt @@ -0,0 +1,341 @@ +--TEST-- +basename +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing basic operations *** + +--Iteration 1-- +string(3) "bar" + +--Iteration 2-- +string(3) "bar" + +--Iteration 3-- +string(3) "bar" + +--Iteration 4-- +string(3) "bar" + +--Iteration 5-- +string(3) "bar" + +--Iteration 6-- +string(3) "bar" + +--Iteration 7-- +string(3) "bar" + +--Iteration 8-- +string(3) "bar" + +--Iteration 9-- +string(3) "bar" + +--Iteration 10-- +string(3) "bar" + +--Iteration 11-- +string(7) "bar.zip" + +--Iteration 12-- +string(3) "bar" + +--Iteration 13-- +string(3) "bar" + +--Iteration 14-- +string(3) "bar" + +--Iteration 15-- +string(3) "bar" + +--Iteration 16-- +string(3) "bar" + +--Iteration 17-- +string(3) "bar" + +--Iteration 18-- +string(3) "bar" + +--Iteration 19-- +string(3) "bar" + +--Iteration 20-- +string(4) ".zip" + +--Iteration 21-- +string(4) ".zip" + +--Iteration 22-- +string(4) ".zip" + +--Iteration 23-- +string(4) ".zip" + +--Iteration 24-- +string(4) ".zip" + +--Iteration 25-- +string(4) ".zip" + +*** Testing possible variations in path and suffix *** + +--Iteration 1-- +string(3) "bar" + +--Iteration 2-- +string(3) "bar" + +--Iteration 3-- +string(3) "bar" + +--Iteration 4-- +string(3) "bar" + +--Iteration 5-- +string(3) "bar" + +--Iteration 6-- +string(7) "bar.tar" + +--Iteration 7-- +string(7) "bar.tar" + +--Iteration 8-- +string(7) "bar.tar" + +--Iteration 9-- +string(7) "bar.tar" + +--Iteration 10-- +string(7) "bar.tar" + +--Iteration 11-- +string(7) "bar.tar" + +--Iteration 12-- +string(4) "10.5" + +--Iteration 13-- +string(2) "10" + +--Iteration 14-- +string(4) "10.5" + +--Iteration 15-- +string(2) "10" + +--Iteration 16-- +string(2) "10" + +--Iteration 17-- +string(4) "10.5" + +--Iteration 18-- +string(4) "10.5" + +--Iteration 19-- +string(6) "10.zip" + +--Iteration 20-- +string(1) "0" + +--Iteration 21-- +string(1) "0" + +--Iteration 22-- +string(7) "bar.zip" + +--Iteration 23-- +string(7) "bar.zip" + +--Iteration 24-- +string(7) "bar.zip" + +--Iteration 25-- +string(1) " " + +--Iteration 26-- +string(1) " " + +--Iteration 27-- +string(0) "" + +--Iteration 28-- +string(1) " " + +--Iteration 29-- +string(1) " " + +--Iteration 30-- +string(0) "" + +--Iteration 31-- +string(0) "" + +--Iteration 32-- +string(0) "" + +*** Testing error conditions *** + +Warning: basename() expects at least 1 parameter, 0 given in %s on line %d +NULL + +Warning: basename() expects at most 2 parameters, 3 given in %s on line %d +NULL + +Warning: basename() expects parameter 1 to be string, array given in %s on line %d +NULL + +Warning: basename() expects parameter 1 to be string, array given in %s on line %d +NULL + +Warning: basename() expects parameter 2 to be string, array given in %s on line %d +NULL + +Warning: basename() expects parameter 1 to be string, object given in %s on line %d +NULL + +Warning: basename() expects parameter 1 to be string, object given in %s on line %d +NULL + +Warning: basename() expects parameter 1 to be string, object given in %s on line %d +NULL + +Warning: basename() expects parameter 2 to be string, object given in %s on line %d +NULL +Done diff --git a/ext/standard/tests/file/basename.phpt b/ext/standard/tests/file/basename.phpt new file mode 100644 index 0000000000..c0e7498f14 Binary files /dev/null and b/ext/standard/tests/file/basename.phpt differ diff --git a/ext/standard/tests/file/basename_error.phpt b/ext/standard/tests/file/basename_error.phpt new file mode 100644 index 0000000000..9b168188b5 --- /dev/null +++ b/ext/standard/tests/file/basename_error.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test basename() function : error conditions +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing basename() : error conditions *** + +-- Testing basename() function with Zero arguments -- + +Warning: basename() expects at least 1 parameter, 0 given in %s on line %d +NULL + +-- Testing basename() function with more than expected no. of arguments -- + +Warning: basename() expects at most 2 parameters, 3 given in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/file/bug41655_1.phpt b/ext/standard/tests/file/bug41655_1.phpt index d02de7066a..c2e3c769e7 100644 --- a/ext/standard/tests/file/bug41655_1.phpt +++ b/ext/standard/tests/file/bug41655_1.phpt @@ -4,9 +4,10 @@ Bug #41655 (open_basedir bypass via glob()) 1/2 open_basedir=/tmp --FILE-- --EXPECT-- +bool(false) Done \ No newline at end of file diff --git a/ext/standard/tests/file/chmod_variation3.phpt b/ext/standard/tests/file/chmod_variation3.phpt new file mode 100644 index 0000000000..b1b455d460 --- /dev/null +++ b/ext/standard/tests/file/chmod_variation3.phpt @@ -0,0 +1,216 @@ +--TEST-- +Test chmod() function : first parameter variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for filename + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( chmod($value, $mode) ); +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing chmod() : usage variation *** + +--int 0-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--int 1-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--float .5-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--empty array-- +Error: 8 - Array to string conversion, %s(%d) +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--int indexed array-- +Error: 8 - Array to string conversion, %s(%d) +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--associative array-- +Error: 8 - Array to string conversion, %s(%d) +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--nested arrays-- +Error: 8 - Array to string conversion, %s(%d) +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--uppercase NULL-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--instance of classWithToString-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 4096 - Object of class classWithoutToString could not be converted to string, %s(%d) +Error: 8 - Object of class classWithoutToString to string conversion, %s(%d) +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--undefined var-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) + +--unset var-- +Error: 2 - chmod(): No such file or directory, %s(%d) +bool(false) +===DONE=== diff --git a/ext/standard/tests/file/chmod_variation4.phpt b/ext/standard/tests/file/chmod_variation4.phpt new file mode 100644 index 0000000000..a46b61f650 --- /dev/null +++ b/ext/standard/tests/file/chmod_variation4.phpt @@ -0,0 +1,192 @@ +--TEST-- +Test chmod() function : second parameter variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for mode + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( chmod($filename, $value) ); +}; + +chmod($filename, 0777); +unlink($filename); + +?> +===DONE=== +--EXPECTF-- +*** Testing chmod() : usage variation *** + +--float 10.5-- +bool(true) + +--float -10.5-- +bool(true) + +--float 12.3456789000e10-- +bool(true) + +--float -12.3456789000e10-- +bool(true) + +--float .5-- +bool(true) + +--empty array-- +bool(true) + +--int indexed array-- +bool(true) + +--associative array-- +bool(true) + +--nested arrays-- +bool(true) + +--uppercase NULL-- +bool(true) + +--lowercase null-- +bool(true) + +--lowercase true-- +bool(true) + +--lowercase false-- +bool(true) + +--uppercase TRUE-- +bool(true) + +--uppercase FALSE-- +bool(true) + +--empty string DQ-- +bool(true) + +--empty string SQ-- +bool(true) + +--string DQ-- +bool(true) + +--string SQ-- +bool(true) + +--mixed case string-- +bool(true) + +--heredoc-- +bool(true) + +--instance of classWithToString-- +Error: 8 - Object of class classWithToString could not be converted to int, %s(%d) +bool(true) + +--instance of classWithoutToString-- +Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d) +bool(true) + +--undefined var-- +bool(true) + +--unset var-- +bool(true) +===DONE=== diff --git a/ext/standard/tests/file/copy_variation12-win32.phpt b/ext/standard/tests/file/copy_variation12-win32.phpt index 7696769049..4d39de3bb5 100644 --- a/ext/standard/tests/file/copy_variation12-win32.phpt +++ b/ext/standard/tests/file/copy_variation12-win32.phpt @@ -40,7 +40,7 @@ rmdir(dirname(__FILE__)."/copy_variation12"); --EXPECTF-- *** Test copy() function: Trying to create a copy of an existing dir *** -Warning: copy(%s): failed to open stream: Permission denied in %s on line %d +Warning: copy(): The first argument to copy() function cannot be a directory in %s on line %d bool(false) bool(false) int(0) diff --git a/ext/standard/tests/file/copy_variation13.phpt b/ext/standard/tests/file/copy_variation13.phpt index bd1a21dab5..779f82b6f6 100644 --- a/ext/standard/tests/file/copy_variation13.phpt +++ b/ext/standard/tests/file/copy_variation13.phpt @@ -44,7 +44,7 @@ rmdir(dirname(__FILE__)."/copy_variation13"); *** Test copy() function: Trying to copy dir to file *** *** Testing copy() in copying dir to file *** -Warning: copy(): The first argument to copy() function cannot be a directory in %s/copy_variation13.php on line %d +Warning: copy(): The first argument to copy() function cannot be a directory in %scopy_variation13.php on line %d bool(false) bool(true) bool(true) diff --git a/ext/standard/tests/file/copy_variation18.phpt b/ext/standard/tests/file/copy_variation18.phpt index 18407bd584..53467af8a3 100644 --- a/ext/standard/tests/file/copy_variation18.phpt +++ b/ext/standard/tests/file/copy_variation18.phpt @@ -32,8 +32,13 @@ var_dump( copy($src_file_name, $dest_file_name) ); $stat_after_copy = stat($src_file_name); clearstatcache(); +// compare all stat fields except access time +$stat_keys_to_compare = array("dev", "ino", "mode", "nlink", "uid", "gid", + "rdev", "size", "mtime", "ctime", + "blksize", "blocks"); + echo "Comparing the stats of file before and after copy operation => "; -var_dump( compare_stats($stat_before_copy, $stat_after_copy, $all_stat_keys) ); +var_dump( compare_stats($stat_before_copy, $stat_after_copy, $stat_keys_to_compare) ); echo "*** Done ***\n"; ?> diff --git a/ext/standard/tests/file/dirname_basic-win32.phpt b/ext/standard/tests/file/dirname_basic-win32.phpt new file mode 100644 index 0000000000..61a6e33f5a --- /dev/null +++ b/ext/standard/tests/file/dirname_basic-win32.phpt @@ -0,0 +1,93 @@ +--TEST-- +Test dirname() function : basic functionality +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing dirname() : basic functionality *** +string(0) "" +string(1) "." +string(2) "c:" +string(3) "c:\" +string(3) "c:\" +string(1) "." +string(7) "c:\test" +string(7) "c:\test" +string(8) "c://test" +string(7) "c:\test" +string(15) "/usr/lib/locale" +string(17) "//usr/lib//locale" +string(1) "\" +string(1) "\" +string(1) "\" +string(1) "\" +string(1) "\" +string(15) "/usr/lib/locale" +string(31) "c:\windows/system32\drivers/etc" +string(15) "/usr\lib/locale" +string(15) " c:\test\adir" +string(12) "c:\test\adir" +string(15) " c:\test\adir" +string(18) " /usr/lib/locale" +string(15) "/usr/lib/locale" +string(18) " /usr/lib/locale" +string(1) "." +string(14) " c:\test\adir" +string(1) "\" +string(1) "\" +===DONE=== diff --git a/ext/standard/tests/file/dirname_basic.phpt b/ext/standard/tests/file/dirname_basic.phpt new file mode 100644 index 0000000000..8f1944e2c7 --- /dev/null +++ b/ext/standard/tests/file/dirname_basic.phpt @@ -0,0 +1,94 @@ +--TEST-- +Test dirname() function : basic functionality +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing dirname() : basic functionality *** +string(0) "" +string(1) "." +string(1) "." +string(1) "." +string(1) "." +string(1) "." +string(1) "." +string(1) "." +string(8) "c://test" +string(1) "." +string(15) "/usr/lib/locale" +string(17) "//usr/lib//locale" +string(1) "." +string(1) "." +string(1) "/" +string(1) "/" +string(1) "/" +string(15) "/usr/lib/locale" +string(27) "c:\windows/system32\drivers" +string(8) "/usr\lib" +string(1) "." +string(1) "." +string(1) "." +string(18) " /usr/lib/locale" +string(15) "/usr/lib/locale" +string(18) " /usr/lib/locale" +string(1) "." +string(1) "." +string(1) "/" +string(1) "/" +===DONE=== + diff --git a/ext/standard/tests/file/dirname_error.phpt b/ext/standard/tests/file/dirname_error.phpt new file mode 100644 index 0000000000..4785c94f2b --- /dev/null +++ b/ext/standard/tests/file/dirname_error.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test dirname() function : error conditions +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing dirname() : error conditions *** + +-- Testing dirname() function with Zero arguments -- + +Warning: Wrong parameter count for dirname() in %s on line %d +NULL + +-- Testing dirname() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for dirname() in %s on line %d +NULL +===DONE=== diff --git a/ext/standard/tests/file/dirname_variation1.phpt b/ext/standard/tests/file/dirname_variation1.phpt new file mode 100644 index 0000000000..c48a9bafbe --- /dev/null +++ b/ext/standard/tests/file/dirname_variation1.phpt @@ -0,0 +1,190 @@ +--TEST-- +Test dirname() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for path + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( dirname($value) ); +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing dirname() : usage variation *** + +--int 0-- +string(1) "." + +--int 1-- +string(1) "." + +--int 12345-- +string(1) "." + +--int -12345-- +string(1) "." + +--float 10.5-- +string(1) "." + +--float -10.5-- +string(1) "." + +--float 12.3456789000e10-- +string(1) "." + +--float -12.3456789000e10-- +string(1) "." + +--float .5-- +string(1) "." + +--empty array-- +Error: 8 - Array to string conversion, %s(%d) +string(1) "." + +--int indexed array-- +Error: 8 - Array to string conversion, %s(%d) +string(1) "." + +--associative array-- +Error: 8 - Array to string conversion, %s(%d) +string(1) "." + +--nested arrays-- +Error: 8 - Array to string conversion, %s(%d) +string(1) "." + +--uppercase NULL-- +string(0) "" + +--lowercase null-- +string(0) "" + +--lowercase true-- +string(1) "." + +--lowercase false-- +string(0) "" + +--uppercase TRUE-- +string(1) "." + +--uppercase FALSE-- +string(0) "" + +--empty string DQ-- +string(0) "" + +--empty string SQ-- +string(0) "" + +--instance of classWithToString-- +string(1) "." + +--instance of classWithoutToString-- +Error: 4096 - Object of class classWithoutToString could not be converted to string, %s(%d) +Error: 8 - Object of class classWithoutToString to string conversion, %s(%d) +string(1) "." + +--undefined var-- +string(0) "" + +--unset var-- +string(0) "" +===DONE=== diff --git a/ext/standard/tests/file/disk.phpt b/ext/standard/tests/file/disk.phpt index 6eef4b4a77..e1a74fc984 100644 --- a/ext/standard/tests/file/disk.phpt +++ b/ext/standard/tests/file/disk.phpt @@ -37,8 +37,8 @@ bool(false) Warning: disk_total_space(): No such file or directory in %s on line %d bool(false) -float(%d) -float(%d) +float(%f) +float(%f) Warning: disk_free_space(): No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/disk_free_space_basic.phpt b/ext/standard/tests/file/disk_free_space_basic.phpt index d9412198a0..cae37bad59 100644 --- a/ext/standard/tests/file/disk_free_space_basic.phpt +++ b/ext/standard/tests/file/disk_free_space_basic.phpt @@ -50,15 +50,15 @@ rmdir($file_path.$dir); --EXPECTF-- *** Testing with existing directory *** -float(%d) -float(%d) +float(%f) +float(%f) *** Testing with newly created directory *** Free Space before writing to a file -float(%d) +float(%f) Free Space after writing to a file -float(%d) +float(%f) Free Space Value Is Correct diff --git a/ext/standard/tests/file/disk_free_space_error.phpt b/ext/standard/tests/file/disk_free_space_error.phpt index ee5abc8e8a..945b7b9c84 100644 --- a/ext/standard/tests/file/disk_free_space_error.phpt +++ b/ext/standard/tests/file/disk_free_space_error.phpt @@ -55,12 +55,12 @@ NULL Warning: diskfreespace() expects exactly 1 parameter, 2 given in %s on line %d NULL -Warning: disk_free_space(): No such file or directory in %s on line %d +Warning: disk_free_space(): %s in %s on line %d bool(false) -Warning: diskfreespace(): No such file or directory in %s on line %d +Warning: diskfreespace(): %s in %s on line %d bool(false) -float(%d) -float(%d) +float(%f) +float(%f) -- Done -- diff --git a/ext/standard/tests/file/disk_free_space_variation.phpt b/ext/standard/tests/file/disk_free_space_variation.phpt index ee72eea465..01fa183735 100644 --- a/ext/standard/tests/file/disk_free_space_variation.phpt +++ b/ext/standard/tests/file/disk_free_space_variation.phpt @@ -65,59 +65,59 @@ rmdir($file_path); --EXPECTF-- *** Testing disk_free_space() function with a directory *** -float(%d) -float(%d) +float(%f) +float(%f) *** Testing for the return type *** bool(true) *** Testing disk_free_space() function with different styles of file and directory *** -- Iteration 1 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 2 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 3 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 4 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 5 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 6 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 7 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 8 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 9 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 10 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 11 -- -float(%d) -float(%d) +float(%f) +float(%f) -- Iteration 12 -- -float(%d) -float(%d) +float(%f) +float(%f) --- Done --- diff --git a/ext/standard/tests/file/disk_total_space_basic.phpt b/ext/standard/tests/file/disk_total_space_basic.phpt index caf7452e41..8f3a2f21c3 100644 --- a/ext/standard/tests/file/disk_total_space_basic.phpt +++ b/ext/standard/tests/file/disk_total_space_basic.phpt @@ -38,11 +38,11 @@ rmdir($file_path."/disk_total_space"); --EXPECTF-- *** Testing with existing directory *** -float(%d) +float(%f) *** Testing with newly created directory *** -float(%d) +float(%f) Total Space after writing to a file -float(%d) +float(%f) --- Done --- diff --git a/ext/standard/tests/file/disk_total_space_error.phpt b/ext/standard/tests/file/disk_total_space_error.phpt index 4050997e8e..196028007e 100644 --- a/ext/standard/tests/file/disk_total_space_error.phpt +++ b/ext/standard/tests/file/disk_total_space_error.phpt @@ -46,6 +46,6 @@ NULL Warning: disk_total_space(): No such file or directory in %s on line %d bool(false) -float(%d) +float(%f) --- Done --- diff --git a/ext/standard/tests/file/disk_total_space_variation.phpt b/ext/standard/tests/file/disk_total_space_variation.phpt index f722883a3c..6cd96cd872 100644 --- a/ext/standard/tests/file/disk_total_space_variation.phpt +++ b/ext/standard/tests/file/disk_total_space_variation.phpt @@ -63,46 +63,46 @@ rmdir($file_path.$dir); ?> --EXPECTF-- *** Testing with a directory *** -float(%d) +float(%f) Testing for the return type *** bool(true) *** Testing disk_total_space() function with different directory combinations *** -- Iteration 1 -- -float(%d) +float(%f) -- Iteration 2 -- -float(%d) +float(%f) -- Iteration 3 -- -float(%d) +float(%f) -- Iteration 4 -- -float(%d) +float(%f) -- Iteration 5 -- -float(%d) +float(%f) -- Iteration 6 -- -float(%d) +float(%f) -- Iteration 7 -- -float(%d) +float(%f) -- Iteration 8 -- -float(%d) +float(%f) -- Iteration 9 -- -float(%d) +float(%f) -- Iteration 10 -- -float(%d) +float(%f) -- Iteration 11 -- -float(%d) +float(%f) -- Iteration 12 -- -float(%d) +float(%f) --- Done --- diff --git a/ext/standard/tests/file/feof_basic.phpt b/ext/standard/tests/file/feof_basic.phpt new file mode 100644 index 0000000000..ff1d179f6f --- /dev/null +++ b/ext/standard/tests/file/feof_basic.phpt @@ -0,0 +1,101 @@ +--TEST-- +Test feof() function : basic functionality +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing feof() : basic functionality *** + +*** testing reading complete file using feof to stop *** +some data 10 +bool(false) +*** writing 10 lines, testing feof *** +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +*** testing feof on unclosed file after a read *** +bool(true) +*** testing feof after a seek to near the beginning *** +bool(false) +*** testing feof after a seek to end *** +bool(false) +*** testing feof after a seek passed the end *** +bool(false) +*** closing file, testing eof *** + +Warning: feof(): %d is not a valid stream resource in %s on line %d +Done diff --git a/ext/standard/tests/file/fflush_error.phpt b/ext/standard/tests/file/fflush_error.phpt index bfbd6cc1b1..99ed328a84 100644 --- a/ext/standard/tests/file/fflush_error.phpt +++ b/ext/standard/tests/file/fflush_error.phpt @@ -24,9 +24,10 @@ if($file_handle == false) var_dump( fflush($file_handle, $file_handle) ); fclose($file_handle); +fflush($file_handle); // test invalid arguments : non-resources -echo "-- Testing fflush(): with invalid arguments --\n"; +echo "\n-- Testing fflush(): with invalid arguments --\n"; $invalid_args = array ( "string", 10, @@ -60,6 +61,9 @@ NULL Warning: Wrong parameter count for fflush() in %s on line %d NULL + +Warning: fflush(): %d is not a valid stream resource in %s on line %d + -- Testing fflush(): with invalid arguments -- -- Iteration 1 -- diff --git a/ext/standard/tests/file/fgets_error.phpt b/ext/standard/tests/file/fgets_error.phpt index 347a10d955..d4600480a5 100644 --- a/ext/standard/tests/file/fgets_error.phpt +++ b/ext/standard/tests/file/fgets_error.phpt @@ -99,7 +99,7 @@ bool(false) Warning: fgets(): supplied argument is not a valid stream resource in %s on line %d bool(false) -- Testing fgets() with closed/unset file handle -- -Warning: fgets(): 5 is not a valid stream resource in %s on line %d +Warning: fgets(): %d is not a valid stream resource in %s on line %d bool(false) Warning: fgets(): supplied argument is not a valid stream resource in %s on line %d diff --git a/ext/standard/tests/file/fgets_socket_variation1.phpt b/ext/standard/tests/file/fgets_socket_variation1.phpt new file mode 100644 index 0000000000..57944d8b56 --- /dev/null +++ b/ext/standard/tests/file/fgets_socket_variation1.phpt @@ -0,0 +1,56 @@ +--TEST-- +fgets() with a socket stream +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECT-- +Write some data: + + +Read a line from the client: +string(6) "line1 +" + + +Read another line from the client: +string(6) "line2 +" + + +Close the server side socket and read the remaining data from the client +done diff --git a/ext/standard/tests/file/fgets_socket_variation2.phpt b/ext/standard/tests/file/fgets_socket_variation2.phpt new file mode 100644 index 0000000000..3500837133 --- /dev/null +++ b/ext/standard/tests/file/fgets_socket_variation2.phpt @@ -0,0 +1,63 @@ +--TEST-- +fgets() over a socket with more than a buffer's worth of data +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECT-- +Write data from the file: +int(9000) + +Read lines from the client + +Close the server side socket and read the remaining data from the client +done diff --git a/ext/standard/tests/file/fgets_variation2.phpt b/ext/standard/tests/file/fgets_variation2.phpt index b37a9f099d..3ba4eae96e 100644 --- a/ext/standard/tests/file/fgets_variation2.phpt +++ b/ext/standard/tests/file/fgets_variation2.phpt @@ -43,10 +43,10 @@ echo "Done"; *** Testing fgets() : usage variations *** -- Testing fgets() with closed handle -- -Warning: fgets(): 6 is not a valid stream resource in %s on line %d +Warning: fgets(): %d is not a valid stream resource in %s on line %d bool(false) -Warning: fgets(): 6 is not a valid stream resource in %s on line %d +Warning: fgets(): %d is not a valid stream resource in %s on line %d bool(false) -- Testing fgets() with unset handle -- diff --git a/ext/standard/tests/file/file_exists_error.phpt b/ext/standard/tests/file/file_exists_error.phpt new file mode 100644 index 0000000000..b62b961351 --- /dev/null +++ b/ext/standard/tests/file/file_exists_error.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test file_exists() function : error conditions +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing file_exists() : error conditions *** + +-- Testing file_exists() function with Zero arguments -- + +Warning: Wrong parameter count for file_exists() in %s on line %d +NULL + +-- Testing file_exists() function with more than expected no. of arguments -- + +Warning: Wrong parameter count for file_exists() in %s on line %d +NULL +Done diff --git a/ext/standard/tests/file/file_exists_variation1.phpt b/ext/standard/tests/file/file_exists_variation1.phpt new file mode 100644 index 0000000000..35c86a2808 --- /dev/null +++ b/ext/standard/tests/file/file_exists_variation1.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test file_exists() function : usage variations +--CREDITS-- +Dave Kelsey +--FILE-- + + +--EXPECTF-- +*** Testing file_exists() : usage variations *** +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +Done \ No newline at end of file diff --git a/ext/standard/tests/file/file_get_contents_basic.phpt b/ext/standard/tests/file/file_get_contents_basic.phpt new file mode 100644 index 0000000000..5dc0a5e5c6 --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_basic.phpt @@ -0,0 +1,47 @@ +--TEST-- +file_get_contents() function : basic functionality +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing the basic functionality of the file_get_contents() function *** +-- Testing with simple valid data file -- +string(100) "text text text text text text text text text text text text text text text text text text text text " + +-- Testing with empty file -- +string(0) "" + +*** Done *** diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt new file mode 100644 index 0000000000..9c30c2357c --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -0,0 +1,64 @@ +--TEST-- +Test file_get_contents() function : error conditions +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing error conditions *** + +-- Testing with Non-existing file -- + +Warning: file_get_contents(/no/such/file/or/dir): failed to open stream: No such file or directory in %s on line %d + +-- Testing No.of arguments less than expected -- + +Warning: file_get_contents() expects at least 1 parameter, 0 given in %s on line %d + +-- Testing No.of arguments greater than expected -- + +Warning: file_get_contents() expects at most 5 parameters, 6 given in %s on line %d + +-- Testing for invalid negative maxlen values -- +Warning: file_get_contents(): length must be greater than or equal to zero in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/file_get_contents_variation1.phpt b/ext/standard/tests/file/file_get_contents_variation1.phpt new file mode 100644 index 0000000000..ddc926180d --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation1.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test file_get_contents() function : variation - include path testing +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing file_get_contents() : variation *** +File in include path +===DONE=== diff --git a/ext/standard/tests/file/file_get_contents_variation2.phpt b/ext/standard/tests/file/file_get_contents_variation2.phpt new file mode 100644 index 0000000000..54816604c3 --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation2.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test file_get_contents() function : variation - include path testing +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing file_get_contents() : variation *** +File in script location +===DONE=== diff --git a/ext/standard/tests/file/file_get_contents_variation3.phpt b/ext/standard/tests/file/file_get_contents_variation3.phpt new file mode 100644 index 0000000000..f485b0ecf5 --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation3.phpt @@ -0,0 +1,218 @@ +--TEST-- +Test file_get_contents() function : usage variation - different type for use_include_path +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for use_include_path + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( file_get_contents($absFile, $value) ); +}; + +unlink($absFile); + +?> +===DONE=== +--EXPECTF-- +*** Testing file_get_contents() : usage variation *** + +--int 0-- +string(13) "contents read" + +--int 1-- +string(13) "contents read" + +--int 12345-- +string(%d) "contents read" + +--int -12345-- +string(%d) "contents read" + +--float 10.5-- +string(%d) "contents read" + +--float -10.5-- +string(%d) "contents read" + +--float 12.3456789000e10-- +string(%d) "contents read" + +--float -12.3456789000e10-- +string(%d) "contents read" + +--float .5-- +string(%d) "contents read" + +--empty array-- +Error: 2 - file_get_contents() expects parameter 2 to be boolean, array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - file_get_contents() expects parameter 2 to be boolean, array given, %s(%d) +NULL + +--associative array-- +Error: 2 - file_get_contents() expects parameter 2 to be boolean, array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - file_get_contents() expects parameter 2 to be boolean, array given, %s(%d) +NULL + +--uppercase NULL-- +string(%d) "contents read" + +--lowercase null-- +string(%d) "contents read" + +--lowercase true-- +string(%d) "contents read" + +--lowercase false-- +string(%d) "contents read" + +--uppercase TRUE-- +string(%d) "contents read" + +--uppercase FALSE-- +string(%d) "contents read" + +--empty string DQ-- +string(%d) "contents read" + +--empty string SQ-- +string(%d) "contents read" + +--string DQ-- +string(%d) "contents read" + +--string SQ-- +string(%d) "contents read" + +--mixed case string-- +string(%d) "contents read" + +--heredoc-- +string(%d) "contents read" + +--instance of classWithToString-- +Error: 2 - file_get_contents() expects parameter 2 to be boolean, object given, %s(%d) +NULL + +--instance of classWithoutToString-- +Error: 2 - file_get_contents() expects parameter 2 to be boolean, object given, %s(%d) +NULL + +--undefined var-- +string(%d) "contents read" + +--unset var-- +string(%d) "contents read" +===DONE=== diff --git a/ext/standard/tests/file/file_get_contents_variation4.phpt b/ext/standard/tests/file/file_get_contents_variation4.phpt new file mode 100644 index 0000000000..3b494b4491 --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation4.phpt @@ -0,0 +1,251 @@ +--TEST-- +Test file_get_contents() function : usage variation - different types for context. +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + //non context resource + 'file resource' => $fileRes, + + //valid stream context + 'stream context' => $strContext, +); + +// loop through each element of the array for context + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( file_get_contents($absFile, false, $value) ); +}; + +unlink($absFile); +fclose($fileRes); + +?> +===DONE=== +--EXPECTF-- +*** Testing file_get_contents() : usage variation *** + +--int 0-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, integer given, %s(%d) +NULL + +--int 1-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, integer given, %s(%d) +NULL + +--int 12345-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, integer given, %s(%d) +NULL + +--int -12345-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, integer given, %s(%d) +NULL + +--float 10.5-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, double given, %s(%d) +NULL + +--float -10.5-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, double given, %s(%d) +NULL + +--float 12.3456789000e10-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, double given, %s(%d) +NULL + +--float -12.3456789000e10-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, double given, %s(%d) +NULL + +--float .5-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, double given, %s(%d) +NULL + +--empty array-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, array given, %s(%d) +NULL + +--associative array-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, array given, %s(%d) +NULL + +--uppercase NULL-- +string(%d) "contents read" + +--lowercase null-- +string(%d) "contents read" + +--lowercase true-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, boolean given, %s(%d) +NULL + +--lowercase false-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, boolean given, %s(%d) +NULL + +--uppercase TRUE-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, boolean given, %s(%d) +NULL + +--uppercase FALSE-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, boolean given, %s(%d) +NULL + +--empty string DQ-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, string given, %s(%d) +NULL + +--empty string SQ-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, string given, %s(%d) +NULL + +--string DQ-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, string given, %s(%d) +NULL + +--string SQ-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, string given, %s(%d) +NULL + +--mixed case string-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, string given, %s(%d) +NULL + +--heredoc-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, string given, %s(%d) +NULL + +--instance of classWithToString-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, object given, %s(%d) +NULL + +--instance of classWithoutToString-- +Error: 2 - file_get_contents() expects parameter 3 to be resource, object given, %s(%d) +NULL + +--undefined var-- +string(%d) "contents read" + +--unset var-- +string(%d) "contents read" + +--file resource-- +Error: 2 - file_get_contents(): supplied resource is not a valid Stream-Context resource, %s(%d) +string(%d) "contents read" + +--stream context-- +string(%d) "contents read" +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/file_get_contents_variation5.phpt b/ext/standard/tests/file/file_get_contents_variation5.phpt new file mode 100644 index 0000000000..9b400310cb --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation5.phpt @@ -0,0 +1,222 @@ +--TEST-- +Test file_get_contents() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for offset + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( file_get_contents($absFile, false, null, $value) ); +}; + +unlink($absFile); + +?> +===DONE=== +--EXPECTF-- +*** Testing file_get_contents() : usage variation *** + +--int 0-- +string(%d) "contents read" + +--int 1-- +string(%d) "ontents read" + +--int 12345-- +string(%d) "" + +--int -12345-- +string(%d) "contents read" + +--float 10.5-- +string(3) "ead" + +--float -10.5-- +string(%d) "contents read" + +--float 12.3456789000e10-- +string(%d) %s + +--float -12.3456789000e10-- +string(%d) %s + +--float .5-- +string(%d) "contents read" + +--empty array-- +Error: 2 - file_get_contents() expects parameter 4 to be long, array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - file_get_contents() expects parameter 4 to be long, array given, %s(%d) +NULL + +--associative array-- +Error: 2 - file_get_contents() expects parameter 4 to be long, array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - file_get_contents() expects parameter 4 to be long, array given, %s(%d) +NULL + +--uppercase NULL-- +string(%d) "contents read" + +--lowercase null-- +string(%d) "contents read" + +--lowercase true-- +string(12) "ontents read" + +--lowercase false-- +string(%d) "contents read" + +--uppercase TRUE-- +string(12) "ontents read" + +--uppercase FALSE-- +string(%d) "contents read" + +--empty string DQ-- +Error: 2 - file_get_contents() expects parameter 4 to be long, string given, %s(%d) +NULL + +--empty string SQ-- +Error: 2 - file_get_contents() expects parameter 4 to be long, string given, %s(%d) +NULL + +--string DQ-- +Error: 2 - file_get_contents() expects parameter 4 to be long, string given, %s(%d) +NULL + +--string SQ-- +Error: 2 - file_get_contents() expects parameter 4 to be long, string given, %s(%d) +NULL + +--mixed case string-- +Error: 2 - file_get_contents() expects parameter 4 to be long, string given, %s(%d) +NULL + +--heredoc-- +Error: 2 - file_get_contents() expects parameter 4 to be long, string given, %s(%d) +NULL + +--instance of classWithToString-- +Error: 2 - file_get_contents() expects parameter 4 to be long, object given, %s(%d) +NULL + +--instance of classWithoutToString-- +Error: 2 - file_get_contents() expects parameter 4 to be long, object given, %s(%d) +NULL + +--undefined var-- +string(%d) "contents read" + +--unset var-- +string(%d) "contents read" +===DONE=== diff --git a/ext/standard/tests/file/file_get_contents_variation6.phpt b/ext/standard/tests/file/file_get_contents_variation6.phpt new file mode 100644 index 0000000000..6795e0165a --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation6.phpt @@ -0,0 +1,215 @@ +--TEST-- +Test file_get_contents() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for maxlen + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( file_get_contents($absFile, false, null, 0, $value) ); +}; + +unlink($absFile); + +?> +===DONE=== +--EXPECTF-- +*** Testing file_get_contents() : usage variation *** + +--int 0-- +string(%d) "" + +--int 1-- +string(%d) "c" + +--int 12345-- +string(%d) "contents read" + +--int -12345-- +Error: 2 - file_get_contents(): length must be greater than or equal to zero, %s(%d) +bool(false) + +--float 10.5-- +string(%d) "contents r" + +--float -10.5-- +Error: 2 - file_get_contents(): length must be greater than or equal to zero, %s(%d) +bool(false) + +--float .5-- +string(%d) "" + +--empty array-- +Error: 2 - file_get_contents() expects parameter 5 to be long, array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - file_get_contents() expects parameter 5 to be long, array given, %s(%d) +NULL + +--associative array-- +Error: 2 - file_get_contents() expects parameter 5 to be long, array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - file_get_contents() expects parameter 5 to be long, array given, %s(%d) +NULL + +--uppercase NULL-- +string(%d) "" + +--lowercase null-- +string(%d) "" + +--lowercase true-- +string(%d) "c" + +--lowercase false-- +string(%d) "" + +--uppercase TRUE-- +string(%d) "c" + +--uppercase FALSE-- +string(%d) "" + +--empty string DQ-- +Error: 2 - file_get_contents() expects parameter 5 to be long, string given, %s(%d) +NULL + +--empty string SQ-- +Error: 2 - file_get_contents() expects parameter 5 to be long, string given, %s(%d) +NULL + +--string DQ-- +Error: 2 - file_get_contents() expects parameter 5 to be long, string given, %s(%d) +NULL + +--string SQ-- +Error: 2 - file_get_contents() expects parameter 5 to be long, string given, %s(%d) +NULL + +--mixed case string-- +Error: 2 - file_get_contents() expects parameter 5 to be long, string given, %s(%d) +NULL + +--heredoc-- +Error: 2 - file_get_contents() expects parameter 5 to be long, string given, %s(%d) +NULL + +--instance of classWithToString-- +Error: 2 - file_get_contents() expects parameter 5 to be long, object given, %s(%d) +NULL + +--instance of classWithoutToString-- +Error: 2 - file_get_contents() expects parameter 5 to be long, object given, %s(%d) +NULL + +--undefined var-- +string(%d) "" + +--unset var-- +string(%d) "" +===DONE=== diff --git a/ext/standard/tests/file/file_get_contents_variation7-win32.phpt b/ext/standard/tests/file/file_get_contents_variation7-win32.phpt new file mode 100644 index 0000000000..d350b4b037 --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation7-win32.phpt @@ -0,0 +1,115 @@ +--TEST-- +Test file_get_contents() function : variation - various absolute and relative paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing file_get_contents() : variation *** + +-- Iteration 1 -- +string(%d) "contents read" + +-- Iteration 2 -- +string(%d) "contents read" + +-- Iteration 3 -- +string(%d) "contents read" + +-- Iteration 4 -- +string(%d) "contents read" + +-- Iteration 5 -- + +Warning: file_get_contents(%sfileGetContentsVar7.dir\fileGetContentsVar7Sub\..\\\fileGetContentsVar7Sub\\..\\..\fileGetContentsVar7Sub\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: file_get_contents(%sfileGetContentsVar7.dir\fileGetContentsVar7Sub\BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 7 -- +string(%d) "contents read" + +-- Iteration 8 -- +string(%d) "contents read" + +-- Iteration 9 -- +string(%d) "contents read" + +-- Iteration 10 -- +string(%d) "contents read" + +-- Iteration 11 -- + +Warning: file_get_contents(BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 12 -- +string(%d) "contents read" + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/file_get_contents_variation7.phpt b/ext/standard/tests/file/file_get_contents_variation7.phpt new file mode 100644 index 0000000000..c076857025 --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation7.phpt @@ -0,0 +1,104 @@ +--TEST-- +Test file_get_contents() function : variation - various absolute and relative paths +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing file_get_contents() : variation *** + +-- Iteration 1 -- +string(%d) "contents read" + +-- Iteration 2 -- +string(%d) "contents read" + +-- Iteration 3 -- +string(%d) "contents read" + +-- Iteration 4 -- +string(%d) "contents read" + +-- Iteration 5 -- + +Warning: file_get_contents(%sfileGetContentsVar7.dir/fileGetContentsVar7Sub/..///fileGetContentsVar7Sub//..//../fileGetContentsVar7Sub/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: file_get_contents(%sfileGetContentsVar7.dir/fileGetContentsVar7Sub/BADDIR/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 7 -- +string(%d) "contents read" + +-- Iteration 8 -- +string(%d) "contents read" + +-- Iteration 9 -- +string(%d) "contents read" + +-- Iteration 10 -- +string(%d) "contents read" + +-- Iteration 11 -- + +Warning: file_get_contents(BADDIR/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/file_get_contents_variation8-win32.phpt b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt new file mode 100644 index 0000000000..4e67a33452 --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt @@ -0,0 +1,79 @@ +--TEST-- +Test file_get_contents() function : variation - obscure filenames +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing file_get_contents() : variation *** +-- Iteration 0 -- + +Warning: file_get_contents(-1): failed to open stream: No such file or directory in %s on line %d +bool(false) +-- Iteration 1 -- + +Warning: file_get_contents(1): failed to open stream: No such file or directory in %s on line %d +bool(false) +-- Iteration 2 -- +bool(false) +-- Iteration 3 -- +bool(false) +-- Iteration 4 -- +bool(false) +-- Iteration 5 -- + +Warning: file_get_contents( ): failed to open stream: Permission denied in %s on line %d +bool(false) +-- Iteration 6 -- +bool(false) +-- Iteration 7 -- + +Warning: file_get_contents() expects parameter 1 to be string, array given in %s on line %d +NULL +-- Iteration 8 -- + +Warning: file_get_contents(/no/such/file/dir): failed to open stream: No such file or directory in %s on line %d +bool(false) +-- Iteration 9 -- + +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 diff --git a/ext/standard/tests/file/file_get_contents_variation8.phpt b/ext/standard/tests/file/file_get_contents_variation8.phpt new file mode 100644 index 0000000000..21b3d2b311 --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation8.phpt @@ -0,0 +1,79 @@ +--TEST-- +Test file_get_contents() function : variation - obscure filenames +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing file_get_contents() : variation *** +-- Iteration 0 -- + +Warning: file_get_contents(-1): failed to open stream: No such file or directory in %s on line %d +bool(false) +-- Iteration 1 -- + +Warning: file_get_contents(1): failed to open stream: No such file or directory in %s on line %d +bool(false) +-- Iteration 2 -- +bool(false) +-- Iteration 3 -- +bool(false) +-- Iteration 4 -- +bool(false) +-- Iteration 5 -- + +Warning: file_get_contents( ): failed to open stream: No such file or directory in %s on line %d +bool(false) +-- Iteration 6 -- +bool(false) +-- Iteration 7 -- + +Warning: file_get_contents() expects parameter 1 to be string, array given in %s on line %d +NULL +-- Iteration 8 -- + +Warning: file_get_contents(/no/such/file/dir): failed to open stream: No such file or directory in %s on line %d +bool(false) +-- Iteration 9 -- + +Warning: file_get_contents(php/php): failed to open stream: %s directory in %s on line %d +bool(false) + +*** Done *** diff --git a/ext/standard/tests/file/file_get_contents_variation9.phpt b/ext/standard/tests/file/file_get_contents_variation9.phpt new file mode 100644 index 0000000000..988a3102d2 --- /dev/null +++ b/ext/standard/tests/file/file_get_contents_variation9.phpt @@ -0,0 +1,56 @@ +--TEST-- +Test file_get_contents() function : variation - linked files +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing file_get_contents() : variation *** +string(330) "Here is a repeated amount of data%s" +string(330) "Here is a repeated amount of data%s" +string(330) "Here is a repeated amount of data%s" + +*** Done *** + diff --git a/ext/standard/tests/file/file_put_contents_variation1.phpt b/ext/standard/tests/file/file_put_contents_variation1.phpt new file mode 100644 index 0000000000..35d193095c --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation1.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test file_put_contents() function : variation - test append flag +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing file_put_contents() : variation *** +int(25) +int(18) +43 +The first string to write, followed by this +25 +The first string to write +===DONE=== diff --git a/ext/standard/tests/file/file_put_contents_variation2.phpt b/ext/standard/tests/file/file_put_contents_variation2.phpt new file mode 100644 index 0000000000..dccb967921 --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation2.phpt @@ -0,0 +1,167 @@ +--TEST-- +Test file_put_contents() function : usage variation - different data types to write +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for str + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + file_put_contents($filename, $value); + readfile($filename); +}; +unlink($filename); + +?> +===DONE=== +--EXPECTF-- +*** Testing file_put_contents() : usage variation *** + +--int 0-- +0 +--int 1-- +1 +--int 12345-- +12345 +--int -12345-- +-2345 +--float 10.5-- +10.5 +--float -10.5-- +-10.5 +--float 12.3456789000e10-- +123456789000 +--float -12.3456789000e10-- +-123456789000 +--float .5-- +0.5 +--empty array-- + +--int indexed array-- +123 +--associative array-- +12 +--nested arrays-- +Error: 8 - Array to string conversion, %s(%d) +Error: 8 - Array to string conversion, %s(%d) +fooArrayArray +--uppercase NULL-- + +--lowercase null-- + +--lowercase true-- +1 +--lowercase false-- + +--uppercase TRUE-- +1 +--uppercase FALSE-- + +--empty string DQ-- + +--empty string SQ-- + +--instance of classWithToString-- +Class A object +--instance of classWithoutToString-- + +--undefined var-- + +--unset var-- +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/file_put_contents_variation3.phpt b/ext/standard/tests/file/file_put_contents_variation3.phpt new file mode 100644 index 0000000000..e16f6403c0 --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation3.phpt @@ -0,0 +1,250 @@ +--TEST-- +Test file_put_contents() function : usage variation - different types for context. +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + //non context resource + 'file resource' => $fileRes, + + //valid stream context + 'stream context' => $strContext, +); + +// loop through each element of the array for context + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( file_put_contents($absFile, $data, null, $value) ); +}; + +unlink($absFile); +fclose($fileRes); + +?> +===DONE=== +--EXPECTF-- +*** Testing file_put_contents() : usage variation *** + +--int 0-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, integer given, %s(%d) +NULL + +--int 1-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, integer given, %s(%d) +NULL + +--int 12345-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, integer given, %s(%d) +NULL + +--int -12345-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, integer given, %s(%d) +NULL + +--float 10.5-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, double given, %s(%d) +NULL + +--float -10.5-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, double given, %s(%d) +NULL + +--float 12.3456789000e10-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, double given, %s(%d) +NULL + +--float -12.3456789000e10-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, double given, %s(%d) +NULL + +--float .5-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, double given, %s(%d) +NULL + +--empty array-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, array given, %s(%d) +NULL + +--associative array-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, array given, %s(%d) +NULL + +--uppercase NULL-- +int(13) + +--lowercase null-- +int(13) + +--lowercase true-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, boolean given, %s(%d) +NULL + +--lowercase false-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, boolean given, %s(%d) +NULL + +--uppercase TRUE-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, boolean given, %s(%d) +NULL + +--uppercase FALSE-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, boolean given, %s(%d) +NULL + +--empty string DQ-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, string given, %s(%d) +NULL + +--empty string SQ-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, string given, %s(%d) +NULL + +--string DQ-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, string given, %s(%d) +NULL + +--string SQ-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, string given, %s(%d) +NULL + +--mixed case string-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, string given, %s(%d) +NULL + +--heredoc-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, string given, %s(%d) +NULL + +--instance of classWithToString-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, object given, %s(%d) +NULL + +--instance of classWithoutToString-- +Error: 2 - file_put_contents() expects parameter 4 to be resource, object given, %s(%d) +NULL + +--undefined var-- +int(13) + +--unset var-- +int(13) + +--file resource-- +Error: 2 - file_put_contents(): supplied resource is not a valid Stream-Context resource, %s(%d) +int(13) + +--stream context-- +int(13) +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/file_put_contents_variation4.phpt b/ext/standard/tests/file/file_put_contents_variation4.phpt new file mode 100644 index 0000000000..15fdceb8dd --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation4.phpt @@ -0,0 +1,53 @@ +--TEST-- +Test file_put_contents() function : variation - include path testing +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing file_put_contents() : variation *** +File in include path +File in include path +===DONE=== diff --git a/ext/standard/tests/file/file_put_contents_variation5.phpt b/ext/standard/tests/file/file_put_contents_variation5.phpt new file mode 100644 index 0000000000..d4ccacc258 --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation5.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test file_put_contents() function : variation - include path testing +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing file_put_contents() : variation *** +File in script location +File in script location +File in script location +File in script location +===DONE=== + diff --git a/ext/standard/tests/file/file_put_contents_variation6.phpt b/ext/standard/tests/file/file_put_contents_variation6.phpt new file mode 100644 index 0000000000..dbe6c9daa8 --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation6.phpt @@ -0,0 +1,54 @@ +--TEST-- +Test file_put_contents() function : variation - include path testing +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing file_put_contents() : variation *** +File in include path. This was appended +File in include path. This was appended +===DONE=== diff --git a/ext/standard/tests/file/file_put_contents_variation7-win32.phpt b/ext/standard/tests/file/file_put_contents_variation7-win32.phpt new file mode 100644 index 0000000000..d7bfdf9233 --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation7-win32.phpt @@ -0,0 +1,130 @@ +--TEST-- +Test file_put_contents() function : usage variation - various absolute and relative paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing file_put_contents() : usage variation *** + +-- Iteration 1 -- +Data written correctly + +-- Iteration 2 -- +Data written correctly + +-- Iteration 3 -- +Data written correctly + +-- Iteration 4 -- +Data written correctly + +-- Iteration 5 -- + +Warning: file_put_contents(%sfilePutContentsVar7.dir\filePutContentsVar7Sub\..\\\filePutContentsVar7Sub\\..\\..\filePutContentsVar7Sub\FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +No data written + +-- Iteration 6 -- + +Warning: file_put_contents(%sfilePutContentsVar7.dir\filePutContentsVar7Sub\BADDIR\FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +No data written + +-- Iteration 7 -- +Data written correctly + +-- Iteration 8 -- +Data written correctly + +-- Iteration 9 -- +Data written correctly + +-- Iteration 10 -- +Data written correctly + +-- Iteration 11 -- + +Warning: file_put_contents(BADDIR\FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +No data written + +-- Iteration 12 -- +Data written correctly + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/file_put_contents_variation7.phpt b/ext/standard/tests/file/file_put_contents_variation7.phpt new file mode 100644 index 0000000000..5c8e5f3602 --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation7.phpt @@ -0,0 +1,119 @@ +--TEST-- +Test file_put_contents() function : usage variation - various absolute and relative paths +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing file_put_contents() : usage variation *** + +-- Iteration 1 -- +Data written correctly + +-- Iteration 2 -- +Data written correctly + +-- Iteration 3 -- +Data written correctly + +-- Iteration 4 -- +Data written correctly + +-- Iteration 5 -- + +Warning: file_put_contents(%sfilePutContentsVar7.dir/filePutContentsVar7Sub/..///filePutContentsVar7Sub//..//../filePutContentsVar7Sub/FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +No data written + +-- Iteration 6 -- + +Warning: file_put_contents(%sfilePutContentsVar7.dir/filePutContentsVar7Sub/BADDIR/FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +No data written + +-- Iteration 7 -- +Data written correctly + +-- Iteration 8 -- +Data written correctly + +-- Iteration 9 -- +Data written correctly + +-- Iteration 10 -- +Data written correctly + +-- Iteration 11 -- + +Warning: file_put_contents(BADDIR/FileGetContentsVar7.tmp): failed to open stream: %s in %s on line %d +No data written + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt new file mode 100644 index 0000000000..ce06019e86 --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt @@ -0,0 +1,82 @@ +--TEST-- +Test file_put_contents() function : usage variation - obscure filenames +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing file_put_contents() : usage variation *** +-- Iteration 0 -- +9 bytes written to: -1 +-- Iteration 1 -- +9 bytes written to: 1 +-- Iteration 2 -- +Failed to write data to: +-- Iteration 3 -- +Failed to write data to: +-- Iteration 4 -- +Failed to write data to: +-- Iteration 5 -- + +Warning: file_put_contents( ): failed to open stream: Permission denied in %s on line %d +Failed to write data to: +-- Iteration 6 -- +Failed to write data to:%s +-- Iteration 7 -- + +Warning: file_put_contents() expects parameter 1 to be string, array given in %s on line %d +Failed to write data to: Array +-- Iteration 8 -- + +Warning: file_put_contents(/no/such/file/dir): failed to open stream: %s in %s on line %d +Failed to write data to: /no/such/file/dir +-- Iteration 9 -- + +Warning: file_put_contents(php/php): failed to open stream: %s in %s on line %d +Failed to write data to: php/php + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/file_put_contents_variation8.phpt b/ext/standard/tests/file/file_put_contents_variation8.phpt new file mode 100644 index 0000000000..6042ecf982 --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation8.phpt @@ -0,0 +1,81 @@ +--TEST-- +Test file_put_contents() function : usage variation - obscure filenames +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing file_put_contents() : usage variation *** +-- Iteration 0 -- +9 bytes written to: -1 +-- Iteration 1 -- +9 bytes written to: 1 +-- Iteration 2 -- +Failed to write data to: +-- Iteration 3 -- +Failed to write data to: +-- Iteration 4 -- +Failed to write data to: +-- Iteration 5 -- +9 bytes written to: +-- Iteration 6 -- +Failed to write data to:%s +-- Iteration 7 -- + +Warning: file_put_contents() expects parameter 1 to be string, array given in %s on line %d +Failed to write data to: Array +-- Iteration 8 -- + +Warning: file_put_contents(/no/such/file/dir): failed to open stream: %s in %s on line %d +Failed to write data to: /no/such/file/dir +-- Iteration 9 -- + +Warning: file_put_contents(php/php): failed to open stream: %s in %s on line %d +Failed to write data to: php/php + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/file_put_contents_variation9.phpt b/ext/standard/tests/file/file_put_contents_variation9.phpt new file mode 100644 index 0000000000..7ad09c449d --- /dev/null +++ b/ext/standard/tests/file/file_put_contents_variation9.phpt @@ -0,0 +1,70 @@ +--TEST-- +est file_put_contents() function : usage variation - linked files +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECT-- +*** Testing file_put_contents() : usage variation *** +int(17) +int(11) +Here is some data, more data +int(17) +int(11) +Here is some data, more data +int(17) +int(11) +Here is some data, more data + +*** Done *** diff --git a/ext/standard/tests/file/file_variation8-win32.phpt b/ext/standard/tests/file/file_variation8-win32.phpt new file mode 100644 index 0000000000..ca3be36b56 --- /dev/null +++ b/ext/standard/tests/file/file_variation8-win32.phpt @@ -0,0 +1,142 @@ +--TEST-- +Test file() function : variation - various absolute and relative paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing file() : variation *** + +-- Iteration 1 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 2 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 3 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 4 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 5 -- + +Warning: file(%sfileVar8.dir\fileVar8Sub\..\\\fileVar8Sub\\..\\..\fileVar8Sub\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: file(%sfileVar8.dir\fileVar8Sub\BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 7 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 8 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 9 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 10 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 11 -- + +Warning: file(BADDIR\FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 12 -- +array(1) { + [0]=> + string(13) "contents read" +} + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/file_variation8.phpt b/ext/standard/tests/file/file_variation8.phpt new file mode 100644 index 0000000000..be18fcb032 --- /dev/null +++ b/ext/standard/tests/file/file_variation8.phpt @@ -0,0 +1,128 @@ +--TEST-- +Test file function : variation - various absolute and relative paths +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing file() : variation *** + +-- Iteration 1 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 2 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 3 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 4 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 5 -- + +Warning: file(%sfileVar8.dir/fileVar8Sub/..///fileVar8Sub//..//../fileVar8Sub/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: file(%sfileVar8.dir/fileVar8Sub/BADDIR/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 7 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 8 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 9 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 10 -- +array(1) { + [0]=> + string(13) "contents read" +} + +-- Iteration 11 -- + +Warning: file(BADDIR/FileGetContentsVar7.tmp): failed to open stream: No such file or directory in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/file_variation9.phpt b/ext/standard/tests/file/file_variation9.phpt new file mode 100644 index 0000000000..9ddd1e6209 --- /dev/null +++ b/ext/standard/tests/file/file_variation9.phpt @@ -0,0 +1,89 @@ +--TEST-- +Test file function : variation - test various endings of a file +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing file() : variation *** +array(2) { + [0]=> + string(32) "File ends on a single character +" + [1]=> + string(1) "a" +} +array(1) { + [0]=> + string(24) "File ends on a new line +" +} +array(4) { + [0]=> + string(31) "File ends on multiple newlines +" + [1]=> + string(1) " +" + [2]=> + string(1) " +" + [3]=> + string(1) " +" +} +array(4) { + [0]=> + string(9) "File has +" + [1]=> + string(1) " +" + [2]=> + string(28) "multiple lines and newlines +" + [3]=> + string(1) " +" +} +array(3) { + [0]=> + string(10) "File has +" + [1]=> + string(15) "multiple crlfs +" + [2]=> + string(2) " +" +} + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/filegroup_variation1.phpt b/ext/standard/tests/file/filegroup_variation1.phpt new file mode 100644 index 0000000000..ee76477ac8 --- /dev/null +++ b/ext/standard/tests/file/filegroup_variation1.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test filegroup() function: usage variations - links +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--CLEAN-- + + +--EXPECTF-- +*** Testing filegroup() with links *** +int(%d) +int(%d) + +*** Done *** diff --git a/ext/standard/tests/file/filegroup_variation2.phpt b/ext/standard/tests/file/filegroup_variation2.phpt new file mode 100644 index 0000000000..14f6b86c3c --- /dev/null +++ b/ext/standard/tests/file/filegroup_variation2.phpt @@ -0,0 +1,70 @@ +--TEST-- +Test filegroup() function: usage variations - invalid filenames +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing Invalid file types *** + +Warning: filegroup(): stat failed for -2.34555 in %s on line %d +bool(false) + +Warning: filegroup(): stat failed for in %s on line %d +bool(false) +bool(false) + +Warning: filegroup(): stat failed for 1 in %s on line %d +bool(false) +bool(false) +bool(false) + +Warning: filegroup(): stat failed for Resource id #%d in %s on line %d +bool(false) + +Warning: filegroup(): stat failed for 1234 in %s on line %d +bool(false) + +Warning: filegroup(): stat failed for 0 in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/filegroup_variation3.phpt b/ext/standard/tests/file/filegroup_variation3.phpt new file mode 100644 index 0000000000..dd875a082b --- /dev/null +++ b/ext/standard/tests/file/filegroup_variation3.phpt @@ -0,0 +1,81 @@ +--TEST-- +Test filegroup() function: usage variations - diff. path notations +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing filegroup() with different notations of file names *** +- Iteration 1 - +int(%d) +- Iteration 2 - + +Warning: filegroup(): stat failed for %s//filegroup_variation3/filegroup_variation3.tmp/ in %s on line %d +bool(false) +- Iteration 3 - +int(%d) +- Iteration 4 - +int(%d) +- Iteration 5 - + +Warning: filegroup(): stat failed for %s//filegroup_variation3/*.tmp in %s on line %d +bool(false) +- Iteration 6 - + +Warning: filegroup(): stat failed for %s/filegroup_variation3/filegroup*.tmp in %s on line %d +bool(false) +- Iteration 7 - +int(%d) +- Iteration 8 - +int(%d) + +*** Done *** diff --git a/ext/standard/tests/file/fileinode_variation1.phpt b/ext/standard/tests/file/fileinode_variation1.phpt new file mode 100644 index 0000000000..d251cc3f85 --- /dev/null +++ b/ext/standard/tests/file/fileinode_variation1.phpt @@ -0,0 +1,48 @@ +--TEST-- +Test fileinode() function: usage variations - links +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--CLEAN-- + + +--EXPECTF-- +*** Testing fileinode() with links *** +int(%d) +int(%d) + +*** Done *** diff --git a/ext/standard/tests/file/fileinode_variation2.phpt b/ext/standard/tests/file/fileinode_variation2.phpt new file mode 100644 index 0000000000..65ba056e60 --- /dev/null +++ b/ext/standard/tests/file/fileinode_variation2.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test fileinode() function: usage variations - invalid filenames +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing Invalid file types *** + +Warning: fileinode(): stat failed for -2.34555 in %s on line %d +bool(false) + +Warning: fileinode(): stat failed for in %s on line %d +bool(false) +bool(false) + +Warning: fileinode(): stat failed for 1 in %s on line %d +bool(false) +bool(false) +bool(false) + +Warning: fileinode(): stat failed for Resource id #%d in %s on line %d +bool(false) + +Warning: fileinode(): stat failed for 1234 in %s on line %d +bool(false) + +Warning: fileinode(): stat failed for 0 in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/fileinode_variation3.phpt b/ext/standard/tests/file/fileinode_variation3.phpt new file mode 100644 index 0000000000..c81b573246 --- /dev/null +++ b/ext/standard/tests/file/fileinode_variation3.phpt @@ -0,0 +1,82 @@ +--TEST-- +Test fileinode() function: usage variations - diff. path notations +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing fileinode() with different notations of file names *** +- Iteration 1 - +int(%d) +- Iteration 2 - + +Warning: fileinode(): stat failed for %s//fileinode_variation3/fileinode_variation3.tmp/ in %s on line %d +bool(false) +- Iteration 3 - +int(%d) +- Iteration 4 - +int(%d) +- Iteration 5 - + +Warning: fileinode(): stat failed for %s//fileinode_variation3/*.tmp in %s on line %d +bool(false) +- Iteration 6 - + +Warning: fileinode(): stat failed for %s/fileinode_variation3/fileinode*.tmp in %s on line %d +bool(false) +- Iteration 7 - +int(%d) +- Iteration 8 - +int(%d) + +*** Done *** diff --git a/ext/standard/tests/file/fileowner_variation1.phpt b/ext/standard/tests/file/fileowner_variation1.phpt new file mode 100644 index 0000000000..b70ac366d2 --- /dev/null +++ b/ext/standard/tests/file/fileowner_variation1.phpt @@ -0,0 +1,48 @@ +--TEST-- +Test fileowner() function: usage variations - links +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--CLEAN-- + + +--EXPECTF-- +*** Testing fileowner() with links *** +int(%d) +int(%d) + +*** Done *** diff --git a/ext/standard/tests/file/fileowner_variation2.phpt b/ext/standard/tests/file/fileowner_variation2.phpt new file mode 100644 index 0000000000..c529c1bc37 --- /dev/null +++ b/ext/standard/tests/file/fileowner_variation2.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test fileowner() function: usage variations - invalid filenames +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing Invalid file types *** + +Warning: fileowner(): stat failed for -2.34555 in %s on line %d +bool(false) + +Warning: fileowner(): stat failed for in %s on line %d +bool(false) +bool(false) + +Warning: fileowner(): stat failed for 1 in %s on line %d +bool(false) +bool(false) +bool(false) + +Warning: fileowner(): stat failed for Resource id #%d in %s on line %d +bool(false) + +Warning: fileowner(): stat failed for 1234 in %s on line %d +bool(false) + +Warning: fileowner(): stat failed for 0 in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/fileowner_variation3.phpt b/ext/standard/tests/file/fileowner_variation3.phpt new file mode 100644 index 0000000000..2a322b6dbc --- /dev/null +++ b/ext/standard/tests/file/fileowner_variation3.phpt @@ -0,0 +1,82 @@ +--TEST-- +Test fileowner() function: usage variations - diff. path notations +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing fileowner() with different notations of file names *** +- Iteration 1 - +int(%d) +- Iteration 2 - + +Warning: fileowner(): stat failed for %s//fileowner_variation3/fileowner_variation3.tmp/ in %s on line %d +bool(false) +- Iteration 3 - +int(%d) +- Iteration 4 - +int(%d) +- Iteration 5 - + +Warning: fileowner(): stat failed for %s//fileowner_variation3/*.tmp in %s on line %d +bool(false) +- Iteration 6 - + +Warning: fileowner(): stat failed for %s/fileowner_variation3/fileowner*.tmp in %s on line %d +bool(false) +- Iteration 7 - +int(%d) +- Iteration 8 - +int(%d) + +*** Done *** diff --git a/ext/standard/tests/file/fileperms_variation1.phpt b/ext/standard/tests/file/fileperms_variation1.phpt new file mode 100644 index 0000000000..e90cf8784f --- /dev/null +++ b/ext/standard/tests/file/fileperms_variation1.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test fileperms() function: usage variations - links +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--CLEAN-- + + +--EXPECTF-- +*** Testing fileperms() with links *** +int(%d) +int(%d) + +*** Done *** diff --git a/ext/standard/tests/file/fileperms_variation2.phpt b/ext/standard/tests/file/fileperms_variation2.phpt new file mode 100644 index 0000000000..ecd6cedb41 --- /dev/null +++ b/ext/standard/tests/file/fileperms_variation2.phpt @@ -0,0 +1,70 @@ +--TEST-- +Test fileperms() function: usage variations - invalid filenames +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing Invalid file types *** + +Warning: fileperms(): stat failed for -2.34555 in %s on line %d +bool(false) + +Warning: fileperms(): stat failed for in %s on line %d +bool(false) +bool(false) + +Warning: fileperms(): stat failed for 1 in %s on line %d +bool(false) +bool(false) +bool(false) + +Warning: fileperms(): stat failed for Resource id #%d in %s on line %d +bool(false) + +Warning: fileperms(): stat failed for 1234 in %s on line %d +bool(false) + +Warning: fileperms(): stat failed for 0 in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/fileperms_variation3.phpt b/ext/standard/tests/file/fileperms_variation3.phpt new file mode 100644 index 0000000000..38101e363c --- /dev/null +++ b/ext/standard/tests/file/fileperms_variation3.phpt @@ -0,0 +1,81 @@ +--TEST-- +Test fileperms() function: usage variations - diff. path notations +--CREDITS-- +Dave Kelsey +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing fileperms() with different notations of file names *** +- Iteration 1 - +int(%d) +- Iteration 2 - + +Warning: fileperms(): stat failed for %s//fileperms_variation3/fileperms_variation3.tmp/ in %s on line %d +bool(false) +- Iteration 3 - +int(%d) +- Iteration 4 - +int(%d) +- Iteration 5 - + +Warning: fileperms(): stat failed for %s//fileperms_variation3/*.tmp in %s on line %d +bool(false) +- Iteration 6 - + +Warning: fileperms(): stat failed for %s/fileperms_variation3/fileperms*.tmp in %s on line %d +bool(false) +- Iteration 7 - +int(%d) +- Iteration 8 - +int(%d) + +*** Done *** diff --git a/ext/standard/tests/file/filesize_variation1.phpt b/ext/standard/tests/file/filesize_variation1.phpt index a8a4d4e7f5..8d18f68ee1 100644 --- a/ext/standard/tests/file/filesize_variation1.phpt +++ b/ext/standard/tests/file/filesize_variation1.phpt @@ -32,14 +32,14 @@ echo "Done\n"; --EXPECTF-- *** Testing filesize(): usage variations *** *** Checking filesize() with different size of files *** -int(1024) -int(1025024) -int(2049024) -int(3073024) -int(4097024) -int(5121024) -int(6145024) -int(7169024) -int(8193024) -int(9217024) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) +int(%d) Done diff --git a/ext/standard/tests/file/filesize_variation5.phpt b/ext/standard/tests/file/filesize_variation5.phpt new file mode 100644 index 0000000000..638f8ba8ed --- /dev/null +++ b/ext/standard/tests/file/filesize_variation5.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test filesize() function: usage variations - size of files +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing filesize(): usage variations *** +bool(false) +bool(false) +bool(false) + +Warning: filesize(): stat failed for in %s on line %d +bool(false) + +Warning: filesize(): stat failed for | in %s on line %d +bool(false) +*** Done *** diff --git a/ext/standard/tests/file/filetype_variation2.phpt b/ext/standard/tests/file/filetype_variation2.phpt new file mode 100644 index 0000000000..95885757cd --- /dev/null +++ b/ext/standard/tests/file/filetype_variation2.phpt @@ -0,0 +1,36 @@ +--TEST-- +Test filetype() function: Variations +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing filetype() with various types *** +-- Checking for char -- +char +-- Checking for block -- +block + +*** Done *** diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt index 077e5430ba..fe61e2a173 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -94,7 +94,7 @@ NULL Warning: flock() expects parameter 2 to be long, string given in %s on line %d NULL -Warning: flock(): 6 is not a valid stream resource in %s on line %d +Warning: flock(): %d is not a valid stream resource in %s on line %d bool(false) Warning: flock() expects parameter 1 to be resource, string given in %s on line %d diff --git a/ext/standard/tests/file/flock_variation.phpt b/ext/standard/tests/file/flock_variation.phpt index d34f78f7f2..339f10cb9f 100644 --- a/ext/standard/tests/file/flock_variation.phpt +++ b/ext/standard/tests/file/flock_variation.phpt @@ -1,328 +1,45 @@ --TEST-- -Test flock() function: Variations +Test flock() function: usage variations --FILE-- --EXPECTF-- -*** Testing flock() fun with the various operation and - wouldblock values *** ---- Outer iteration 0 --- -bool(true) --- Inner iteration 0 in 0 -- -bool(true) --- Inner iteration 1 in 0 -- -bool(true) --- Inner iteration 2 in 0 -- -bool(true) --- Inner iteration 3 in 0 -- -bool(true) --- Inner iteration 4 in 0 -- -bool(true) --- Inner iteration 5 in 0 -- -bool(true) --- Inner iteration 6 in 0 -- -bool(true) --- Inner iteration 7 in 0 -- -bool(true) --- Inner iteration 8 in 0 -- -bool(true) --- Inner iteration 9 in 0 -- -bool(true) --- Inner iteration 10 in 0 -- -bool(true) --- Inner iteration 11 in 0 -- -bool(true) ---- Outer iteration 1 --- -bool(true) --- Inner iteration 0 in 1 -- -bool(true) --- Inner iteration 1 in 1 -- -bool(true) --- Inner iteration 2 in 1 -- -bool(true) --- Inner iteration 3 in 1 -- -bool(true) --- Inner iteration 4 in 1 -- -bool(true) --- Inner iteration 5 in 1 -- -bool(true) --- Inner iteration 6 in 1 -- -bool(true) --- Inner iteration 7 in 1 -- -bool(true) --- Inner iteration 8 in 1 -- -bool(true) --- Inner iteration 9 in 1 -- -bool(true) --- Inner iteration 10 in 1 -- -bool(true) --- Inner iteration 11 in 1 -- -bool(true) ---- Outer iteration 2 --- -bool(true) --- Inner iteration 0 in 2 -- -bool(true) --- Inner iteration 1 in 2 -- -bool(true) --- Inner iteration 2 in 2 -- -bool(true) --- Inner iteration 3 in 2 -- -bool(true) --- Inner iteration 4 in 2 -- -bool(true) --- Inner iteration 5 in 2 -- -bool(true) --- Inner iteration 6 in 2 -- -bool(true) --- Inner iteration 7 in 2 -- -bool(true) --- Inner iteration 8 in 2 -- -bool(true) --- Inner iteration 9 in 2 -- -bool(true) --- Inner iteration 10 in 2 -- -bool(true) --- Inner iteration 11 in 2 -- -bool(true) ---- Outer iteration 3 --- -bool(true) --- Inner iteration 0 in 3 -- -bool(true) --- Inner iteration 1 in 3 -- -bool(true) --- Inner iteration 2 in 3 -- -bool(true) --- Inner iteration 3 in 3 -- -bool(true) --- Inner iteration 4 in 3 -- -bool(true) --- Inner iteration 5 in 3 -- -bool(true) --- Inner iteration 6 in 3 -- -bool(true) --- Inner iteration 7 in 3 -- -bool(true) --- Inner iteration 8 in 3 -- -bool(true) --- Inner iteration 9 in 3 -- -bool(true) --- Inner iteration 10 in 3 -- -bool(true) --- Inner iteration 11 in 3 -- -bool(true) ---- Outer iteration 4 --- -bool(true) --- Inner iteration 0 in 4 -- -bool(true) --- Inner iteration 1 in 4 -- -bool(true) --- Inner iteration 2 in 4 -- -bool(true) --- Inner iteration 3 in 4 -- -bool(true) --- Inner iteration 4 in 4 -- -bool(true) --- Inner iteration 5 in 4 -- -bool(true) --- Inner iteration 6 in 4 -- -bool(true) --- Inner iteration 7 in 4 -- +*** Test flock() function: with the operations given as numeric values *** bool(true) --- Inner iteration 8 in 4 -- bool(true) --- Inner iteration 9 in 4 -- bool(true) --- Inner iteration 10 in 4 -- bool(true) --- Inner iteration 11 in 4 -- bool(true) ---- Outer iteration 5 --- bool(true) --- Inner iteration 0 in 5 -- bool(true) --- Inner iteration 1 in 5 -- bool(true) --- Inner iteration 2 in 5 -- -bool(true) --- Inner iteration 3 in 5 -- -bool(true) --- Inner iteration 4 in 5 -- -bool(true) --- Inner iteration 5 in 5 -- -bool(true) --- Inner iteration 6 in 5 -- -bool(true) --- Inner iteration 7 in 5 -- -bool(true) --- Inner iteration 8 in 5 -- -bool(true) --- Inner iteration 9 in 5 -- -bool(true) --- Inner iteration 10 in 5 -- -bool(true) --- Inner iteration 11 in 5 -- -bool(true) ---- Outer iteration 6 --- -bool(true) --- Inner iteration 0 in 6 -- -bool(true) --- Inner iteration 1 in 6 -- -bool(true) --- Inner iteration 2 in 6 -- -bool(true) --- Inner iteration 3 in 6 -- -bool(true) --- Inner iteration 4 in 6 -- -bool(true) --- Inner iteration 5 in 6 -- -bool(true) --- Inner iteration 6 in 6 -- -bool(true) --- Inner iteration 7 in 6 -- -bool(true) --- Inner iteration 8 in 6 -- -bool(true) --- Inner iteration 9 in 6 -- -bool(true) --- Inner iteration 10 in 6 -- -bool(true) --- Inner iteration 11 in 6 -- -bool(true) ---- Outer iteration 7 --- -bool(true) --- Inner iteration 0 in 7 -- -bool(true) --- Inner iteration 1 in 7 -- -bool(true) --- Inner iteration 2 in 7 -- -bool(true) --- Inner iteration 3 in 7 -- -bool(true) --- Inner iteration 4 in 7 -- -bool(true) --- Inner iteration 5 in 7 -- -bool(true) --- Inner iteration 6 in 7 -- -bool(true) --- Inner iteration 7 in 7 -- -bool(true) --- Inner iteration 8 in 7 -- -bool(true) --- Inner iteration 9 in 7 -- -bool(true) --- Inner iteration 10 in 7 -- -bool(true) --- Inner iteration 11 in 7 -- -bool(true) ---- Outer iteration 8 --- -bool(true) --- Inner iteration 0 in 8 -- -bool(true) --- Inner iteration 1 in 8 -- -bool(true) --- Inner iteration 2 in 8 -- -bool(true) --- Inner iteration 3 in 8 -- -bool(true) --- Inner iteration 4 in 8 -- -bool(true) --- Inner iteration 5 in 8 -- -bool(true) --- Inner iteration 6 in 8 -- -bool(true) --- Inner iteration 7 in 8 -- -bool(true) --- Inner iteration 8 in 8 -- -bool(true) --- Inner iteration 9 in 8 -- -bool(true) --- Inner iteration 10 in 8 -- -bool(true) --- Inner iteration 11 in 8 -- -bool(true) ---- Outer iteration 9 --- -bool(true) --- Inner iteration 0 in 9 -- -bool(true) --- Inner iteration 1 in 9 -- -bool(true) --- Inner iteration 2 in 9 -- -bool(true) --- Inner iteration 3 in 9 -- -bool(true) --- Inner iteration 4 in 9 -- -bool(true) --- Inner iteration 5 in 9 -- -bool(true) --- Inner iteration 6 in 9 -- -bool(true) --- Inner iteration 7 in 9 -- -bool(true) --- Inner iteration 8 in 9 -- -bool(true) --- Inner iteration 9 in 9 -- -bool(true) --- Inner iteration 10 in 9 -- -bool(true) --- Inner iteration 11 in 9 -- -bool(true) - *** Done *** diff --git a/ext/standard/tests/file/flock_variation1.phpt b/ext/standard/tests/file/flock_variation1.phpt new file mode 100644 index 0000000000..3e3f5108e8 --- /dev/null +++ b/ext/standard/tests/file/flock_variation1.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test flock() function: usage variations +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- diff --git a/ext/standard/tests/file/fopen_include_path.inc b/ext/standard/tests/file/fopen_include_path.inc new file mode 100644 index 0000000000..7d6723a815 --- /dev/null +++ b/ext/standard/tests/file/fopen_include_path.inc @@ -0,0 +1,92 @@ + \ No newline at end of file diff --git a/ext/standard/tests/file/fopen_variation10-win32.phpt b/ext/standard/tests/file/fopen_variation10-win32.phpt new file mode 100644 index 0000000000..cae634cb21 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation10-win32.phpt @@ -0,0 +1,143 @@ +--TEST-- +Test fopen() function : variation: interesting paths, no use include path +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing fopen() : variation *** + +--c:\-- +file in root + +--c:-- +file in root + +--c-- + +Warning: fopen(c\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +--\-- + +Warning: fopen(\\fopen_variation10.tmp): failed to open stream: Invalid argument in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +--/-- + +Warning: fopen(/\fopen_variation10.tmp): failed to open stream: Invalid argument in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +--c:fopen10.tmpdirTwo-- +file in fopen10.tmpdirTwo + +--c:adir-- + +Warning: fopen(c:adir\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +--c:\/-- +file in root + +--c:\fopen10.tmpdirTwo\/-- +file in fopen10.tmpdirTwo + +--c:\fopen10.tmpdirTwo\-- +file in fopen10.tmpdirTwo + +--c:\fopen10.tmpdirTwo/-- +file in fopen10.tmpdirTwo + +--/%s/fopen10.tmpDir-- +file in fopen10.tmpDir + +--/sortout-- + +Warning: fopen(/sortout\fopen_variation10.tmp): failed to open stream: No such file or directory in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation11-win32.phpt b/ext/standard/tests/file/fopen_variation11-win32.phpt new file mode 100644 index 0000000000..aca4e8f9a2 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation11-win32.phpt @@ -0,0 +1,142 @@ +--TEST-- +Test fopen() function : variation: interesting paths, use include path = true +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing fopen() : variation *** + +--c:\-- +file in root + +--c:-- +file in root + +--c-- + +Warning: fopen(c\fopen_variation11.tmp): failed to open stream: No such file or directory in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +--\-- + +Warning: fopen(\\fopen_variation11.tmp): failed to open stream: Invalid argument in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +--/-- + +Warning: fopen(/\fopen_variation11.tmp): failed to open stream: Invalid argument in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +--c:fopen11.tmpdirTwo-- +file in fopen11.tmpdirTwo + +--c:adir-- + +Warning: fopen(c:adir\fopen_variation11.tmp): failed to open stream: No such file or directory in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +--c:\/-- +file in root + +--c:\fopen11.tmpdirTwo\/-- +file in fopen11.tmpdirTwo + +--c:\fopen11.tmpdirTwo\-- +file in fopen11.tmpdirTwo + +--c:\fopen11.tmpdirTwo/-- +file in fopen11.tmpdirTwo + +--/%s/fopen11.tmpDir-- +file in fopen11.tmpDir + +--/sortout-- + +Warning: fopen(/sortout\fopen_variation11.tmp): failed to open stream: No such file or directory in %s on line %d +file not opened for read + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation12.phpt b/ext/standard/tests/file/fopen_variation12.phpt new file mode 100644 index 0000000000..bfda7f2a38 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation12.phpt @@ -0,0 +1,53 @@ +--TEST-- +Test fopen() function : variation: use include path (path is bad) create a file (relative) +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing fopen() : variation *** +Not created in working dir +created in script dir +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation13.phpt b/ext/standard/tests/file/fopen_variation13.phpt new file mode 100644 index 0000000000..d540d70006 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation13.phpt @@ -0,0 +1,56 @@ +--TEST-- +Test fopen() function : variation: use include path create a file (absolute) +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing fopen() : variation *** +Created in correct location +Created in correct location +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation14-win32.phpt b/ext/standard/tests/file/fopen_variation14-win32.phpt new file mode 100644 index 0000000000..554d8c6ded --- /dev/null +++ b/ext/standard/tests/file/fopen_variation14-win32.phpt @@ -0,0 +1,189 @@ +--TEST-- +Test fopen() function : variation: file uri, no use include path +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing fopen() : variation *** +--- READ: file://fopen14.tmpDir\fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir\fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://fopen14.tmpDir\fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir\fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://./fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://./fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://.\fopen14.tmpDir\fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://.\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://.\fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://.\fopen14.tmpDir\fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://.\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://.\fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- WRITE: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- READ: file://%s/fopen14.tmpDir\fopen_variation14.tmp --- +test passed +--- WRITE: file://%s/fopen14.tmpDir\fopen_variation14.tmp --- +test passed +--- READ: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- WRITE: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- READ: file://../fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://../fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://..\fopen14.tmpDir\fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://..\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://..\fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://..\fopen14.tmpDir\fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://..\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://..\fopen14.tmpDir\fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- WRITE: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- READ: file://%s/fopen14.tmpDir\fopen_variation14.tmp --- +test passed +--- WRITE: file://%s/fopen14.tmpDir\fopen_variation14.tmp --- +test passed +--- READ: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- WRITE: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +===DONE=== + diff --git a/ext/standard/tests/file/fopen_variation14.phpt b/ext/standard/tests/file/fopen_variation14.phpt new file mode 100644 index 0000000000..aa4e05b892 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation14.phpt @@ -0,0 +1,134 @@ +--TEST-- +Test fopen() function : variation: file uri, no use include path +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing fopen() : variation *** +--- READ: file://fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://./fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://./fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- WRITE: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- READ: file://../fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://../fopen14.tmpDir/fopen_variation14.tmp --- + +Warning: fopen(): remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d + +Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +--- WRITE: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- +test passed +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/fopen_variation15-win32.phpt b/ext/standard/tests/file/fopen_variation15-win32.phpt new file mode 100644 index 0000000000..8599306eda --- /dev/null +++ b/ext/standard/tests/file/fopen_variation15-win32.phpt @@ -0,0 +1,193 @@ +--TEST-- +Test fopen() function : variation: file uri, use include path = true +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing fopen() : variation *** +--- READ: file://fopen15.tmpDir\fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir\fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://fopen15.tmpDir\fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir\fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://./fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://./fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://.\fopen15.tmpDir\fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://.\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://.\fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://.\fopen15.tmpDir\fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://.\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://.\fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- WRITE: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- READ: file://%s/fopen15.tmpDir\fopen_variation15.tmp --- +test passed +--- WRITE: file://%s/fopen15.tmpDir\fopen_variation15.tmp --- +test passed +--- READ: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- WRITE: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- READ: file://../fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://../fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://..\fopen15.tmpDir\fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://..\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://..\fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://..\fopen15.tmpDir\fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://..\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://..\fopen15.tmpDir\fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- WRITE: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- READ: file://%s/fopen15.tmpDir\fopen_variation15.tmp --- +test passed +--- WRITE: file://%s/fopen15.tmpDir\fopen_variation15.tmp --- +test passed +--- READ: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- WRITE: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +===DONE=== + diff --git a/ext/standard/tests/file/fopen_variation15.phpt b/ext/standard/tests/file/fopen_variation15.phpt new file mode 100644 index 0000000000..24b01fbe8c --- /dev/null +++ b/ext/standard/tests/file/fopen_variation15.phpt @@ -0,0 +1,138 @@ +--TEST-- +Test fopen() function : variation: file uri, use include path = true +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing fopen() : variation *** +--- READ: file://fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file://./fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://./fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- WRITE: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- READ: file://../fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- WRITE: file://../fopen15.tmpDir/fopen_variation15.tmp --- + +Warning: fopen(): remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d + +Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): failed to open stream: no suitable wrapper could be found in %s on line %d +--- READ: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +--- WRITE: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- +test passed +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/fopen_variation16.phpt b/ext/standard/tests/file/fopen_variation16.phpt new file mode 100644 index 0000000000..df6b98a4f5 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation16.phpt @@ -0,0 +1,73 @@ +--TEST-- +Test fopen() function : variation: use include path create and read a file (relative) +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing fopen() : variation *** +created in dir1 +found file again in dir1 +created in dir1 +found file again in dir1 +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation17.phpt b/ext/standard/tests/file/fopen_variation17.phpt new file mode 100644 index 0000000000..0d3b625cc7 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation17.phpt @@ -0,0 +1,73 @@ +--TEST-- +Test fopen() function : variation: use include path create and read a file (relative) +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing fopen() : variation *** +created in dir1 +found file again in dir1 +created in dir1 +found file again in dir1 +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation19.phpt b/ext/standard/tests/file/fopen_variation19.phpt new file mode 100644 index 0000000000..031ba45734 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation19.phpt @@ -0,0 +1,110 @@ +--TEST-- +Test fopen() function : variation: test opening linked files +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing fopen() : variation *** +*** testing reading of links *** +soft link:Hello World +hard link:Hello World +link of link:Hello World +*** test appending to links *** +soft link:Hello World again! +hard link:Hello World again! again! +link of link:Hello World again! again! again! +*** test overwriting links *** +soft link:Goodbye World +hard link:Goodbye World +link of link:Goodbye World +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation3.phpt b/ext/standard/tests/file/fopen_variation3.phpt new file mode 100644 index 0000000000..3467a3a606 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation3.phpt @@ -0,0 +1,218 @@ +--TEST-- +Test fopen() function : usage variation different datatypes for use_include_path +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for use_include_path + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $h = fopen($filename, $mode, $value); + if ($h !== false) { + echo "ok\n"; + fclose($h); + } + else { + var_dump($h); + } +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing fopen() : usage variation *** + +--int 0-- +ok + +--int 1-- +ok + +--int 12345-- +ok + +--int -12345-- +ok + +--float 10.5-- +ok + +--float -10.5-- +ok + +--float 12.3456789000e10-- +ok + +--float -12.3456789000e10-- +ok + +--float .5-- +ok + +--empty array-- +Error: 2 - fopen() expects parameter 3 to be boolean, array given, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - fopen() expects parameter 3 to be boolean, array given, %s(%d) +bool(false) + +--associative array-- +Error: 2 - fopen() expects parameter 3 to be boolean, array given, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - fopen() expects parameter 3 to be boolean, array given, %s(%d) +bool(false) + +--uppercase NULL-- +ok + +--lowercase null-- +ok + +--lowercase true-- +ok + +--lowercase false-- +ok + +--uppercase TRUE-- +ok + +--uppercase FALSE-- +ok + +--empty string DQ-- +ok + +--empty string SQ-- +ok + +--string DQ-- +ok + +--string SQ-- +ok + +--mixed case string-- +ok + +--heredoc-- +ok + +--instance of classWithToString-- +Error: 2 - fopen() expects parameter 3 to be boolean, object given, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - fopen() expects parameter 3 to be boolean, object given, %s(%d) +bool(false) + +--undefined var-- +ok + +--unset var-- +ok +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation4.phpt b/ext/standard/tests/file/fopen_variation4.phpt new file mode 100644 index 0000000000..61d850c501 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation4.phpt @@ -0,0 +1,251 @@ +--TEST-- +Test fopen() function : usage variation different datatypes for stream context +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + //file resource + 'file resource' => $fileresource +); + +// loop through each element of the array for context + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $h = fopen($filename, $mode, false, $value); + if ($h !== false) { + echo "ok\n"; + fclose($h); + } + else { + var_dump($h); + } +}; + +fclose($fileresource); + +?> +===DONE=== +--EXPECTF-- +*** Testing fopen() : usage variation *** + +--int 0-- +Error: 2 - fopen() expects parameter 4 to be resource, integer given, %s(%d) +bool(false) + +--int 1-- +Error: 2 - fopen() expects parameter 4 to be resource, integer given, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - fopen() expects parameter 4 to be resource, integer given, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - fopen() expects parameter 4 to be resource, integer given, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - fopen() expects parameter 4 to be resource, double given, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - fopen() expects parameter 4 to be resource, double given, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - fopen() expects parameter 4 to be resource, double given, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - fopen() expects parameter 4 to be resource, double given, %s(%d) +bool(false) + +--float .5-- +Error: 2 - fopen() expects parameter 4 to be resource, double given, %s(%d) +bool(false) + +--empty array-- +Error: 2 - fopen() expects parameter 4 to be resource, array given, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - fopen() expects parameter 4 to be resource, array given, %s(%d) +bool(false) + +--associative array-- +Error: 2 - fopen() expects parameter 4 to be resource, array given, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - fopen() expects parameter 4 to be resource, array given, %s(%d) +bool(false) + +--uppercase NULL-- +Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - fopen() expects parameter 4 to be resource, boolean given, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - fopen() expects parameter 4 to be resource, boolean given, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - fopen() expects parameter 4 to be resource, boolean given, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - fopen() expects parameter 4 to be resource, boolean given, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - fopen() expects parameter 4 to be resource, string given, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - fopen() expects parameter 4 to be resource, string given, %s(%d) +bool(false) + +--string DQ-- +Error: 2 - fopen() expects parameter 4 to be resource, string given, %s(%d) +bool(false) + +--string SQ-- +Error: 2 - fopen() expects parameter 4 to be resource, string given, %s(%d) +bool(false) + +--mixed case string-- +Error: 2 - fopen() expects parameter 4 to be resource, string given, %s(%d) +bool(false) + +--heredoc-- +Error: 2 - fopen() expects parameter 4 to be resource, string given, %s(%d) +bool(false) + +--instance of classWithToString-- +Error: 2 - fopen() expects parameter 4 to be resource, object given, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - fopen() expects parameter 4 to be resource, object given, %s(%d) +bool(false) + +--undefined var-- +Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) +bool(false) + +--unset var-- +Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) +bool(false) + +--file resource-- +Error: 2 - fopen(): supplied resource is not a valid Stream-Context resource, %s(%d) +ok +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation5.phpt b/ext/standard/tests/file/fopen_variation5.phpt new file mode 100644 index 0000000000..070ef712da --- /dev/null +++ b/ext/standard/tests/file/fopen_variation5.phpt @@ -0,0 +1,171 @@ +--TEST-- +Test fopen() function : variation: use include path and stream context (absolute directories in path) +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing fopen() : variation *** + +--- testing include path --- + +** testing with mode=r ** +in dir2 +in dir1 +in dir1 + +Warning: fopen(afile.txt): failed to open stream: No such file or directory in %s on line %d + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +in script dir + +** testing with mode=r+ ** +in dir2 +in dir1 +in dir1 + +Warning: fopen(afile.txt): failed to open stream: No such file or directory in %s on line %d + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +in script dir + +** testing with mode=rt ** +in dir2 +in dir1 +in dir1 + +Warning: fopen(afile.txt): failed to open stream: No such file or directory in %s on line %d + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +in script dir +===DONE=== + diff --git a/ext/standard/tests/file/fopen_variation6.phpt b/ext/standard/tests/file/fopen_variation6.phpt new file mode 100644 index 0000000000..3a99212afe --- /dev/null +++ b/ext/standard/tests/file/fopen_variation6.phpt @@ -0,0 +1,44 @@ +--TEST-- +Test fopen() function : variation: use include path and stream context relative/absolute file +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing fopen() : variation *** +This is an absolute file +This is a relative file +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation7.phpt b/ext/standard/tests/file/fopen_variation7.phpt new file mode 100644 index 0000000000..54d567f0d8 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation7.phpt @@ -0,0 +1,68 @@ +--TEST-- +Test fopen() function : variation: use include path create a file (relative) +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing fopen() : variation *** +Not created in working dir +created in dir1 +Not created in working dir +created in dir1 +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation8.phpt b/ext/standard/tests/file/fopen_variation8.phpt new file mode 100644 index 0000000000..60e65df5a4 --- /dev/null +++ b/ext/standard/tests/file/fopen_variation8.phpt @@ -0,0 +1,170 @@ +--TEST-- +Test fopen() function : variation: use include path and stream context (relative directories in path) +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing fopen() : variation *** + +--- testing include path --- + +** testing with mode=r ** +in dir2 +in dir1 +in dir1 + +Warning: fopen(afile.txt): failed to open stream: No such file or directory in %s on line %d + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +in script dir + +** testing with mode=r+ ** +in dir2 +in dir1 +in dir1 + +Warning: fopen(afile.txt): failed to open stream: No such file or directory in %s on line %d + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +in script dir + +** testing with mode=rt ** +in dir2 +in dir1 +in dir1 + +Warning: fopen(afile.txt): failed to open stream: No such file or directory in %s on line %d + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d + +Warning: fclose(): supplied argument is not a valid stream resource in %s on line %d + +in script dir +===DONE=== + diff --git a/ext/standard/tests/file/fopen_variation9.phpt b/ext/standard/tests/file/fopen_variation9.phpt new file mode 100644 index 0000000000..283424b93c --- /dev/null +++ b/ext/standard/tests/file/fopen_variation9.phpt @@ -0,0 +1,67 @@ +--TEST-- +Test fopen() function : variation: use include path and stream context create a file, relative path +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing fopen() : variation *** +Not created in working dir +created in dir1 +Not created in working dir +created in dir1 +===DONE=== diff --git a/ext/standard/tests/file/fpassthru_error.phpt b/ext/standard/tests/file/fpassthru_error.phpt index 68e2e46cdc..c8cdccbf81 100644 --- a/ext/standard/tests/file/fpassthru_error.phpt +++ b/ext/standard/tests/file/fpassthru_error.phpt @@ -20,6 +20,11 @@ var_dump( fpassthru() ); /* No.of args greaer than expected */ var_dump( fpassthru("", "") ); +/* fpassthru on a closed file */ +$h = fopen(__FILE__,'r'); +fclose($h); +fpassthru($h); + echo "\n*** Done ***\n"; ?> @@ -37,4 +42,6 @@ NULL Warning: Wrong parameter count for fpassthru() in %s on line %d NULL +Warning: fpassthru(): %d is not a valid stream resource in %s on line %d + *** Done *** diff --git a/ext/standard/tests/file/fpassthru_variation1.phpt b/ext/standard/tests/file/fpassthru_variation1.phpt new file mode 100644 index 0000000000..b7a69edae9 --- /dev/null +++ b/ext/standard/tests/file/fpassthru_variation1.phpt @@ -0,0 +1,227 @@ +--TEST-- +Test fpassthru() function : usage variations - different parameter types +--CREDITS-- +Dave Kelsey +--FILE-- + 'red', 'item' => 'pen'), + + // null data + NULL, + null, + + // boolean data + true, + false, + TRUE, + FALSE, + + // empty data + "", + '', + + // string data + "string", + 'string', + + // object data + new testClass(), + + // undefined data + $undefined_var, + + // unset data + $unset_var, +); + +// loop through each element of the array for fp + +foreach($values as $value) { + echo "\nArg value $value \n"; + var_dump( fpassthru($value) ); +}; + +echo "Done"; +?> +--EXPECTF-- +*** Testing fpassthru() : usage variations *** + +Arg value 0 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value 1 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value 12345 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value -2345 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value 10.5 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value -10.5 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value 101234567000 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value 1.07654321E-9 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value 0.5 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value Array + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value Array + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value Array + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value Array + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value Array + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value 1 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value 1 + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value string + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value string + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value testClass + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) + +Arg value + +Warning: fpassthru(): supplied argument is not a valid stream resource in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/file/fread_error.phpt b/ext/standard/tests/file/fread_error.phpt index 785a6f64ef..9f9f8eeb89 100644 --- a/ext/standard/tests/file/fread_error.phpt +++ b/ext/standard/tests/file/fread_error.phpt @@ -103,7 +103,7 @@ bool(false) Notice: Undefined variable: file_content_type in %s on line %d -Warning: fread(): 5 is not a valid stream resource in %s on line %d +Warning: fread(): %d is not a valid stream resource in %s on line %d bool(false) Warning: fread(): supplied argument is not a valid stream resource in %s on line %d diff --git a/ext/standard/tests/file/fread_fwrite_basic.phpt b/ext/standard/tests/file/fread_fwrite_basic.phpt new file mode 100644 index 0000000000..0f5c4ed763 --- /dev/null +++ b/ext/standard/tests/file/fread_fwrite_basic.phpt @@ -0,0 +1,72 @@ +--TEST-- +fread & fwrite - Test reading and writing using a single resource +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECT-- +--- testing rw moving about the file --- +start:The 1st +at end: +bool(true) +final:The 1st part of the text +--- testing eof --- +bool(true) +bool(true) +bool(true) +bool(true) +last bytes: xtra +Done \ No newline at end of file diff --git a/ext/standard/tests/file/fseek_dir_basic.phpt b/ext/standard/tests/file/fseek_dir_basic.phpt index c6d0816e91..cde0bf2579 100644 --- a/ext/standard/tests/file/fseek_dir_basic.phpt +++ b/ext/standard/tests/file/fseek_dir_basic.phpt @@ -42,7 +42,7 @@ var_dump(rmdir($path)); ?> --EXPECTF-- call readdir(): -resource(12) of type (stream) +resource(%d) of type (stream) array(6) { [0]=> bool(false) diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt index 2b0a1b2f8f..3accd149b6 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt @@ -91,7 +91,7 @@ bool(false) Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d bool(false) -- Testing fseek() with closed/unset file handle -- -Warning: fseek(): 5 is not a valid stream resource in %s on line %d +Warning: fseek(): %d is not a valid stream resource in %s on line %d bool(false) Warning: fseek(): supplied argument is not a valid stream resource in %s on line %d diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt index d5bad92a6c..7b3eb9cd48 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt @@ -87,7 +87,7 @@ bool(false) Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d bool(false) -- Testing ftell with closed/unset file handle -- -Warning: ftell(): 5 is not a valid stream resource in %s on line %d +Warning: ftell(): %d is not a valid stream resource in %s on line %d bool(false) Warning: ftell(): supplied argument is not a valid stream resource in %s on line %d diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt index 8f0ae38d4f..2fbd0c8057 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt @@ -87,7 +87,7 @@ bool(false) Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d bool(false) -- Testing rewind() with closed/unset file handle -- -Warning: rewind(): 5 is not a valid stream resource in %s on line %d +Warning: rewind(): %d is not a valid stream resource in %s on line %d bool(false) Warning: rewind(): supplied argument is not a valid stream resource in %s on line %d diff --git a/ext/standard/tests/file/fseek_variation1.phpt b/ext/standard/tests/file/fseek_variation1.phpt new file mode 100644 index 0000000000..0e648ffb80 --- /dev/null +++ b/ext/standard/tests/file/fseek_variation1.phpt @@ -0,0 +1,177 @@ +--TEST-- +Test fseek() function : usage variations - different types for offset +--CREDITS-- +Dave Kelsey +--FILE-- + 'red', 'item' => 'pen'), + + // null data + NULL, + null, + + // boolean data + true, + false, + TRUE, + FALSE, + + // empty data + "", + '', + + // string data + "string", + 'string', + + // object data + new testClass(), + + // undefined data + $undefined_var, + + // unset data + $unset_var, +); + +// loop through each element of the array for offset + +foreach($values as $value) { + echo "\nArg value $value \n"; + var_dump( fseek($fp, $value, $whence) ); + var_dump( ftell($fp)); +}; +fclose($fp); + +echo "Done"; +?> +--EXPECT-- +*** Testing fseek() : usage variations *** + +Arg value 10.5 +int(0) +int(10) + +Arg value -10.5 +int(-1) +int(10) + +Arg value 1.07654321E-9 +int(0) +int(0) + +Arg value 0.5 +int(0) +int(0) + +Arg value Array +int(0) +int(0) + +Arg value Array +int(0) +int(1) + +Arg value Array +int(0) +int(1) + +Arg value Array +int(0) +int(1) + +Arg value Array +int(0) +int(1) + +Arg value +int(0) +int(0) + +Arg value +int(0) +int(0) + +Arg value 1 +int(0) +int(1) + +Arg value +int(0) +int(0) + +Arg value 1 +int(0) +int(1) + +Arg value +int(0) +int(0) + +Arg value +int(0) +int(0) + +Arg value +int(0) +int(0) + +Arg value string +int(0) +int(0) + +Arg value string +int(0) +int(0) + +Arg value testClass +int(0) +int(1) + +Arg value +int(0) +int(0) + +Arg value +int(0) +int(0) +Done diff --git a/ext/standard/tests/file/fseek_variation2.phpt b/ext/standard/tests/file/fseek_variation2.phpt new file mode 100644 index 0000000000..983207eeb4 --- /dev/null +++ b/ext/standard/tests/file/fseek_variation2.phpt @@ -0,0 +1,154 @@ +--TEST-- +Test fseek() function : usage variations - different types for whence +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECT-- +*** Testing fseek() : usage variations *** + +Arg value -100 +int(-1) +int(0) + +Arg value 100 +int(-1) +int(0) + +Arg value 10.5 +int(-1) +int(0) + +Arg value -10.5 +int(-1) +int(0) + +Arg value 101234567000 +int(-1) +int(0) + +Arg value 1.07654321E-9 +int(0) +int(3) + +Arg value 0.5 +int(0) +int(3) + +Arg value +int(0) +int(3) + +Arg value +int(0) +int(3) + +Arg value 1 +int(0) +int(6) + +Arg value +int(0) +int(3) + +Arg value 1 +int(0) +int(6) + +Arg value +int(0) +int(3) + +Arg value +int(0) +int(3) + +Arg value +int(0) +int(3) + +Arg value string +int(0) +int(3) + +Arg value string +int(0) +int(3) + +Arg value +int(0) +int(3) + +Arg value +int(0) +int(3) +Done diff --git a/ext/standard/tests/file/fseek_variation3.phpt b/ext/standard/tests/file/fseek_variation3.phpt new file mode 100644 index 0000000000..57dad36775 --- /dev/null +++ b/ext/standard/tests/file/fseek_variation3.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test fseek() function : variation functionality beyond file boundaries +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing fseek() : variation - beyond file boundaries *** +--- fseek beyond start of file --- +int(-1) +after -4 seek: +int(0) +after seek back 1: 39 +int(-1) +after seek back 20: +--- fseek beyond end of file --- +int(0) +31323334353637383900000000000000656e64 +Done diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt index 182ade5ffc..54fbae7dd0 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -23,12 +23,14 @@ var_dump( ftruncate() ); // arguments less than expected numbers var_dump( ftruncate( $file_handle ) ); // check the first size +clearstatcache(); var_dump( filesize($filename) ); echo "-- Testing ftruncate() with more than expected number of arguments --\n"; // more than expected number of arguments var_dump( ftruncate($file_handle, 10, 20) ); -// check the first size +// check the first size +clearstatcache(); var_dump( filesize($filename) ); // test invalid arguments : non-resources @@ -53,14 +55,16 @@ echo "-- Testing ftruncate() with closed/unset file handle --\n"; // ftruncate on close file handle fclose($file_handle); var_dump( ftruncate($file_handle,10) ); -// check the first size +// check the first size +clearstatcache(); var_dump( filesize($filename) ); // ftruncate on a file handle which is unset $fp = fopen($filename, "w"); unset($fp); //unset file handle var_dump( ftruncate(@$fp,10)); -// check the first size +// check the first size +clearstatcache(); var_dump( filesize($filename) ); echo "Done\n"; @@ -114,11 +118,11 @@ Warning: ftruncate(): supplied argument is not a valid stream resource in %s on bool(false) -- Testing ftruncate() with closed/unset file handle -- -Warning: ftruncate(): 5 is not a valid stream resource in %s on line %d +Warning: ftruncate(): %d is not a valid stream resource in %s on line %d bool(false) int(36) Warning: ftruncate(): supplied argument is not a valid stream resource in %s on line %d bool(false) -int(36) +int(0) Done diff --git a/ext/standard/tests/file/fwrite_error.phpt b/ext/standard/tests/file/fwrite_error.phpt index c6f529f404..fb562171d3 100644 --- a/ext/standard/tests/file/fwrite_error.phpt +++ b/ext/standard/tests/file/fwrite_error.phpt @@ -112,7 +112,7 @@ Warning: fwrite(): supplied argument is not a valid stream resource in %s on lin bool(false) -- Testing fwrite() with closed/unset file handle -- -Warning: fwrite(): 6 is not a valid stream resource in %s on line %d +Warning: fwrite(): %d is not a valid stream resource in %s on line %d bool(false) Warning: fwrite(): supplied argument is not a valid stream resource in %s on line %d diff --git a/ext/standard/tests/file/fwrite_variation5.phpt b/ext/standard/tests/file/fwrite_variation5.phpt new file mode 100644 index 0000000000..efe4967e1d --- /dev/null +++ b/ext/standard/tests/file/fwrite_variation5.phpt @@ -0,0 +1,173 @@ +--TEST-- +Test fwrite() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for str + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $fp = fopen($filename,'w'); + fwrite($fp, $value); + fclose($fp); + readfile($filename); +}; +unlink($filename); + +?> +===DONE=== +--EXPECTF-- +*** Testing fwrite() : usage variation *** + +--int 0-- +0 +--int 1-- +1 +--int 12345-- +12345 +--int -12345-- +-2345 +--float 10.5-- +10.5 +--float -10.5-- +-10.5 +--float 12.3456789000e10-- +123456789000 +--float -12.3456789000e10-- +-123456789000 +--float .5-- +0.5 +--empty array-- +Error: 8 - Array to string conversion, %s(%d) +Array +--int indexed array-- +Error: 8 - Array to string conversion, %s(%d) +Array +--associative array-- +Error: 8 - Array to string conversion, %s(%d) +Array +--nested arrays-- +Error: 8 - Array to string conversion, %s(%d) +Array +--uppercase NULL-- + +--lowercase null-- + +--lowercase true-- +1 +--lowercase false-- + +--uppercase TRUE-- +1 +--uppercase FALSE-- + +--empty string DQ-- + +--empty string SQ-- + +--instance of classWithToString-- +Class A object +--instance of classWithoutToString-- +Error: 4096 - Object of class classWithoutToString could not be converted to string, %s(%d) +Error: 8 - Object of class classWithoutToString to string conversion, %s(%d) +Object +--undefined var-- + +--unset var-- +===DONE=== diff --git a/ext/standard/tests/file/glob_basic.phpt b/ext/standard/tests/file/glob_basic.phpt index 68e1bc74b1..fc269c442f 100755 --- a/ext/standard/tests/file/glob_basic.phpt +++ b/ext/standard/tests/file/glob_basic.phpt @@ -25,14 +25,19 @@ $fp = fopen("$dirname/file.text", "w"); fclose($fp); // glob() with default arguments -var_dump( glob($dirname."/*") ); -var_dump( glob($dirname."/*.txt") ); -var_dump( glob($dirname."/*.t?t") ); -var_dump( glob($dirname."/*.t*t") ); -var_dump( glob($dirname."/*.?") ); -var_dump( glob($dirname."/*.*") ); +sort_var_dump( glob($dirname."/*") ); +sort_var_dump( glob($dirname."/*.txt") ); +sort_var_dump( glob($dirname."/*.t?t") ); +sort_var_dump( glob($dirname."/*.t*t") ); +sort_var_dump( glob($dirname."/*.?") ); +sort_var_dump( glob($dirname."/*.*") ); echo "Done\n"; + +function sort_var_dump($results) { + sort($results); + var_dump($results); +} ?> --CLEAN-- +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing glob() : error condition - pattern too long. *** + +Warning: glob(): Pattern exceeds the maximum allowed length of %d characters in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/file/is_dir_variation2.phpt b/ext/standard/tests/file/is_dir_variation2.phpt index 70fe94e44f..8817256793 100644 --- a/ext/standard/tests/file/is_dir_variation2.phpt +++ b/ext/standard/tests/file/is_dir_variation2.phpt @@ -70,7 +70,7 @@ bool(true) -- With symlink -- bool(true) -- With hardlink -- -Warning: link(): %s in %s on line %d +Warning: link(): %s bool(false) *** Testing is_dir() with file and links to a file *** diff --git a/ext/standard/tests/file/is_dir_variation3.phpt b/ext/standard/tests/file/is_dir_variation3.phpt index c9b20420c7..a79d686d4d 100644 --- a/ext/standard/tests/file/is_dir_variation3.phpt +++ b/ext/standard/tests/file/is_dir_variation3.phpt @@ -18,6 +18,7 @@ $dirnames = array( TRUE, FALSE, NULL, + " ", $dir_handle, /* scalars */ @@ -42,5 +43,6 @@ bool(false) bool(false) bool(false) bool(false) +bool(false) *** Done *** diff --git a/ext/standard/tests/file/is_executable_variation3.phpt b/ext/standard/tests/file/is_executable_variation3.phpt index 777599cbf9..c87c12db32 100644 --- a/ext/standard/tests/file/is_executable_variation3.phpt +++ b/ext/standard/tests/file/is_executable_variation3.phpt @@ -37,6 +37,7 @@ $invalid_files = array( TRUE, FALSE, NULL, + " ", @array(), @$file_handle ); @@ -59,6 +60,7 @@ bool(false) bool(false) bool(false) bool(false) +bool(false) Notice: Array to string conversion in %s on line %d bool(false) diff --git a/ext/standard/tests/file/is_file_variation3.phpt b/ext/standard/tests/file/is_file_variation3.phpt index af7501315e..e6f2a3ef97 100644 --- a/ext/standard/tests/file/is_file_variation3.phpt +++ b/ext/standard/tests/file/is_file_variation3.phpt @@ -16,6 +16,7 @@ echo "*** Testing Invalid file types ***\n"; $filenames = array( /* Invalid filenames */ -2.34555, + " ", "", TRUE, FALSE, @@ -51,5 +52,6 @@ bool(false) bool(false) bool(false) bool(false) +bool(false) *** Done *** diff --git a/ext/standard/tests/file/is_file_variation4.phpt b/ext/standard/tests/file/is_file_variation4.phpt index fc0cab85cc..55aeedfaad 100644 --- a/ext/standard/tests/file/is_file_variation4.phpt +++ b/ext/standard/tests/file/is_file_variation4.phpt @@ -1,5 +1,5 @@ --TEST-- -Test is_file() function: usage variations - diff. path notations (Bug #42027, #42638) +Test is_file() function: usage variations - diff. path notations (Bug #42027) --FILE-- --FILE-- --FILE-- +--SKIPIF-- + +--POST_RAW-- +Content-type: multipart/form-data, boundary=AaB03x + +--AaB03x +content-disposition: form-data; name="field1" + +Joe Blow +--AaB03x +content-disposition: form-data; name="pics"; filename="file1.txt" +Content-Type: text/plain + +abcdef123456789 +--AaB03x-- +--FILE-- + +--EXPECTF-- +bool(true) +bool(false) +bool(false) +bool(false) + +Warning: Wrong parameter count for is_uploaded_file() in %s on line %d +NULL + +Warning: Wrong parameter count for is_uploaded_file() in %s on line %d +NULL + diff --git a/ext/standard/tests/file/is_writable_variation1.phpt b/ext/standard/tests/file/is_writable_variation1.phpt index 2d0da9b186..bf3e7e1171 100644 --- a/ext/standard/tests/file/is_writable_variation1.phpt +++ b/ext/standard/tests/file/is_writable_variation1.phpt @@ -2,19 +2,19 @@ Test is_writable() and its alias is_writeable() function: usage variations - diff. path notations --SKIPIF-- --FILE-- --FILE-- +--FILE-- + +--EXPECTF-- +*** testing stat *** +bool(false) +bool(false) +bool(false) + +Warning: stat(): stat failed for in %s on line %d +bool(false) + +Warning: stat(): stat failed for | in %s on line %d +bool(false) +*** testing lstat *** +bool(false) +bool(false) +bool(false) + +Warning: lstat(): Lstat failed for in %s on line %d +bool(false) + +Warning: lstat(): Lstat failed for | in %s on line %d +bool(false) +Done \ No newline at end of file diff --git a/ext/standard/tests/file/mkdir_variation1-win32.phpt b/ext/standard/tests/file/mkdir_variation1-win32.phpt new file mode 100644 index 0000000000..7fb51bce07 --- /dev/null +++ b/ext/standard/tests/file/mkdir_variation1-win32.phpt @@ -0,0 +1,123 @@ +--TEST-- +Test mkdir() function : usage variation: try invalid pathname +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase false' =>false, + 'uppercase FALSE' =>FALSE, + + // empty data + // php and p8 output No Such File or Dir. Windows outputs Invalid Argument + 'empty string DQ' => "", + 'empty string SQ' => '', + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // other + // php.net bug outputs message File Exists + 'single space' => ' ', +); + +// loop through each element of the array for pathname + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $res = mkdir($value); + if ($res == true) { + echo "directory created\n"; + rmdir($value); + } +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing mkdir() : usage variation *** + +--uppercase NULL-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--lowercase null-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--lowercase false-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--uppercase FALSE-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--empty string DQ-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--empty string SQ-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--undefined var-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--unset var-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--single space-- +Error: 2 - mkdir(): %s, %s(%d) +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/mkdir_variation1.phpt b/ext/standard/tests/file/mkdir_variation1.phpt new file mode 100644 index 0000000000..85962757e6 --- /dev/null +++ b/ext/standard/tests/file/mkdir_variation1.phpt @@ -0,0 +1,121 @@ +--TEST-- +Test mkdir() function : usage variation: try invalid pathname +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase false' =>false, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // other + 'single space' => ' ', +); + +// loop through each element of the array for pathname + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $res = mkdir($value); + if ($res == true) { + echo "directory created\n"; + rmdir($value); + } +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing mkdir() : usage variation *** + +--uppercase NULL-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--lowercase null-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--lowercase false-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--uppercase FALSE-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--empty string DQ-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--empty string SQ-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--undefined var-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--unset var-- +Error: 2 - mkdir(): No such file or directory, %s(%d) + +--single space-- +directory created +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/mkdir_variation2.phpt b/ext/standard/tests/file/mkdir_variation2.phpt new file mode 100644 index 0000000000..ab9a676ac1 --- /dev/null +++ b/ext/standard/tests/file/mkdir_variation2.phpt @@ -0,0 +1,189 @@ +--TEST-- +Test mkdir() function : usage variation: different types for mode +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for mode + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $h = mkdir($pathname, $value); + if ($h === true) { + echo "Directory created\n"; + rmdir($pathname); + } +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing mkdir() : usage variation *** + +--float 10.5-- +Directory created + +--float -10.5-- +Directory created + +--float 12.3456789000e10-- +Directory created + +--float -12.3456789000e10-- +Directory created + +--float .5-- +Directory created + +--empty array-- +Error: 2 - mkdir() expects parameter 2 to be long, array given, %s(%d) + +--int indexed array-- +Error: 2 - mkdir() expects parameter 2 to be long, array given, %s(%d) + +--associative array-- +Error: 2 - mkdir() expects parameter 2 to be long, array given, %s(%d) + +--nested arrays-- +Error: 2 - mkdir() expects parameter 2 to be long, array given, %s(%d) + +--uppercase NULL-- +Directory created + +--lowercase null-- +Directory created + +--lowercase true-- +Directory created + +--lowercase false-- +Directory created + +--uppercase TRUE-- +Directory created + +--uppercase FALSE-- +Directory created + +--empty string DQ-- +Error: 2 - mkdir() expects parameter 2 to be long, string given, %s(%d) + +--empty string SQ-- +Error: 2 - mkdir() expects parameter 2 to be long, string given, %s(%d) + +--string DQ-- +Error: 2 - mkdir() expects parameter 2 to be long, string given, %s(%d) + +--string SQ-- +Error: 2 - mkdir() expects parameter 2 to be long, string given, %s(%d) + +--mixed case string-- +Error: 2 - mkdir() expects parameter 2 to be long, string given, %s(%d) + +--heredoc-- +Error: 2 - mkdir() expects parameter 2 to be long, string given, %s(%d) + +--instance of classWithToString-- +Error: 2 - mkdir() expects parameter 2 to be long, object given, %s(%d) + +--instance of classWithoutToString-- +Error: 2 - mkdir() expects parameter 2 to be long, object given, %s(%d) + +--undefined var-- +Directory created + +--unset var-- +Directory created +===DONE=== diff --git a/ext/standard/tests/file/mkdir_variation3.phpt b/ext/standard/tests/file/mkdir_variation3.phpt new file mode 100644 index 0000000000..7622e5f612 --- /dev/null +++ b/ext/standard/tests/file/mkdir_variation3.phpt @@ -0,0 +1,208 @@ +--TEST-- +Test mkdir() function : usage variation: different types for recursive +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for recursive + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $h = mkdir($pathname, $mode, $value); + if ($h === true) { + echo "Directory created\n"; + rmdir($pathname); + } +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing mkdir() : usage variation *** + +--int 0-- +Directory created + +--int 1-- +Directory created + +--int 12345-- +Directory created + +--int -12345-- +Directory created + +--float 10.5-- +Directory created + +--float -10.5-- +Directory created + +--float 12.3456789000e10-- +Directory created + +--float -12.3456789000e10-- +Directory created + +--float .5-- +Directory created + +--empty array-- +Error: 2 - mkdir() expects parameter 3 to be boolean, array given, %s(%d) + +--int indexed array-- +Error: 2 - mkdir() expects parameter 3 to be boolean, array given, %s(%d) + +--associative array-- +Error: 2 - mkdir() expects parameter 3 to be boolean, array given, %s(%d) + +--nested arrays-- +Error: 2 - mkdir() expects parameter 3 to be boolean, array given, %s(%d) + +--uppercase NULL-- +Directory created + +--lowercase null-- +Directory created + +--lowercase true-- +Directory created + +--lowercase false-- +Directory created + +--uppercase TRUE-- +Directory created + +--uppercase FALSE-- +Directory created + +--empty string DQ-- +Directory created + +--empty string SQ-- +Directory created + +--string DQ-- +Directory created + +--string SQ-- +Directory created + +--mixed case string-- +Directory created + +--heredoc-- +Directory created + +--instance of classWithToString-- +Error: 2 - mkdir() expects parameter 3 to be boolean, object given, %s(%d) + +--instance of classWithoutToString-- +Error: 2 - mkdir() expects parameter 3 to be boolean, object given, %s(%d) + +--undefined var-- +Directory created + +--unset var-- +Directory created +===DONE=== diff --git a/ext/standard/tests/file/mkdir_variation4.phpt b/ext/standard/tests/file/mkdir_variation4.phpt new file mode 100644 index 0000000000..b97d4ebc74 --- /dev/null +++ b/ext/standard/tests/file/mkdir_variation4.phpt @@ -0,0 +1,220 @@ +--TEST-- +Test mkdir() function : usage variation: different types for context +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +$fileRes = fopen(__FILE__,'r'); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // non stream context resource + 'file resource' => $fileRes, +); + +// loop through each element of the array for context + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $h = mkdir($pathname, $mode, $recursive, $value); + if ($h === true) { + echo "Directory created\n"; + rmdir($pathname); + } +}; + +fclose($fileRes); + +?> +===DONE=== +--EXPECTF-- +*** Testing mkdir() : usage variation *** + +--int 0-- +Error: 2 - mkdir() expects parameter 4 to be resource, integer given, %s(%d) + +--int 1-- +Error: 2 - mkdir() expects parameter 4 to be resource, integer given, %s(%d) + +--int 12345-- +Error: 2 - mkdir() expects parameter 4 to be resource, integer given, %s(%d) + +--int -12345-- +Error: 2 - mkdir() expects parameter 4 to be resource, integer given, %s(%d) + +--float 10.5-- +Error: 2 - mkdir() expects parameter 4 to be resource, double given, %s(%d) + +--float -10.5-- +Error: 2 - mkdir() expects parameter 4 to be resource, double given, %s(%d) + +--float 12.3456789000e10-- +Error: 2 - mkdir() expects parameter 4 to be resource, double given, %s(%d) + +--float -12.3456789000e10-- +Error: 2 - mkdir() expects parameter 4 to be resource, double given, %s(%d) + +--float .5-- +Error: 2 - mkdir() expects parameter 4 to be resource, double given, %s(%d) + +--empty array-- +Error: 2 - mkdir() expects parameter 4 to be resource, array given, %s(%d) + +--int indexed array-- +Error: 2 - mkdir() expects parameter 4 to be resource, array given, %s(%d) + +--associative array-- +Error: 2 - mkdir() expects parameter 4 to be resource, array given, %s(%d) + +--nested arrays-- +Error: 2 - mkdir() expects parameter 4 to be resource, array given, %s(%d) + +--uppercase NULL-- +Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) + +--lowercase null-- +Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) + +--lowercase true-- +Error: 2 - mkdir() expects parameter 4 to be resource, boolean given, %s(%d) + +--lowercase false-- +Error: 2 - mkdir() expects parameter 4 to be resource, boolean given, %s(%d) + +--uppercase TRUE-- +Error: 2 - mkdir() expects parameter 4 to be resource, boolean given, %s(%d) + +--uppercase FALSE-- +Error: 2 - mkdir() expects parameter 4 to be resource, boolean given, %s(%d) + +--empty string DQ-- +Error: 2 - mkdir() expects parameter 4 to be resource, string given, %s(%d) + +--empty string SQ-- +Error: 2 - mkdir() expects parameter 4 to be resource, string given, %s(%d) + +--string DQ-- +Error: 2 - mkdir() expects parameter 4 to be resource, string given, %s(%d) + +--string SQ-- +Error: 2 - mkdir() expects parameter 4 to be resource, string given, %s(%d) + +--mixed case string-- +Error: 2 - mkdir() expects parameter 4 to be resource, string given, %s(%d) + +--heredoc-- +Error: 2 - mkdir() expects parameter 4 to be resource, string given, %s(%d) + +--instance of classWithToString-- +Error: 2 - mkdir() expects parameter 4 to be resource, object given, %s(%d) + +--instance of classWithoutToString-- +Error: 2 - mkdir() expects parameter 4 to be resource, object given, %s(%d) + +--undefined var-- +Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) + +--unset var-- +Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) + +--file resource-- +Error: 2 - mkdir(): supplied resource is not a valid Stream-Context resource, %s(%d) +Directory created +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/mkdir_variation5-win32.phpt b/ext/standard/tests/file/mkdir_variation5-win32.phpt new file mode 100644 index 0000000000..c7ebd518da --- /dev/null +++ b/ext/standard/tests/file/mkdir_variation5-win32.phpt @@ -0,0 +1,105 @@ +--TEST-- +Test mkdir() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing mkdir() : variation *** +-- creating mkdirVar5.tmp\aSubDir -- +Directory created +-- creating .\mkdirVar5.tmp\aSubDir -- +Directory created +-- creating mkdirVar5.tmp\..\mkdirVar5.tmp\aSubDir -- +Directory created +-- creating mkdirVar5.tmp\..\BADDIR\aSubDir -- + +Warning: mkdir(): No such file or directory in %s on line %d +-- creating BADDIR\aSubDir -- + +Warning: mkdir(): No such file or directory in %s on line %d +-- creating %s\mkdirVar5.tmp\aSubDir -- +Directory created +-- creating %s\.\mkdirVar5.tmp\aSubDir -- +Directory created +-- creating %s\mkdirVar5.tmp\..\mkdirVar5.tmp\aSubDir -- +Directory created +-- creating %s\BADDIR\aSubDir -- + +Warning: mkdir(): No such file or directory in %s on line %d +-- creating mkdirVar5.tmp\aSubDir\ -- +Directory created +-- creating %s\mkdirVar5.tmp\aSubDir\ -- +Directory created +-- creating mkdirVar5.tmp\\aSubDir -- +Directory created +-- creating %s\\mkdirVar5.tmp\\aSubDir -- +Directory created +-- creating /%s/mkdirVar5.tmp/aSubDir -- +Directory created +===DONE=== diff --git a/ext/standard/tests/file/mkdir_variation5.phpt b/ext/standard/tests/file/mkdir_variation5.phpt new file mode 100644 index 0000000000..364e5e74b5 --- /dev/null +++ b/ext/standard/tests/file/mkdir_variation5.phpt @@ -0,0 +1,93 @@ +--TEST-- +Test mkdir() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing mkdir() : variation *** +-- creating mkdirVar5.tmp/aSubDir -- +Directory created +-- creating ./mkdirVar5.tmp/aSubDir -- +Directory created +-- creating mkdirVar5.tmp/../mkdirVar5.tmp/aSubDir -- +Directory created +-- creating mkdirVar5.tmp/../BADDIR/aSubDir -- + +Warning: mkdir(): No such file or directory in %s on line %d +-- creating BADDIR/aSubDir -- + +Warning: mkdir(): No such file or directory in %s on line %d +-- creating %s/mkdirVar5.tmp/aSubDir -- +Directory created +-- creating %s/./mkdirVar5.tmp/aSubDir -- +Directory created +-- creating %s/mkdirVar5.tmp/../mkdirVar5.tmp/aSubDir -- +Directory created +-- creating %s/BADDIR/aSubDir -- + +Warning: mkdir(): No such file or directory in %s on line %d +-- creating mkdirVar5.tmp/aSubDir/ -- +Directory created +-- creating %s/mkdirVar5.tmp/aSubDir/ -- +Directory created +-- creating mkdirVar5.tmp//aSubDir -- +Directory created +-- creating %s//mkdirVar5.tmp//aSubDir -- +Directory created +===DONE=== diff --git a/ext/standard/tests/file/move_uploaded_file_basic.phpt b/ext/standard/tests/file/move_uploaded_file_basic.phpt new file mode 100644 index 0000000000..591eec820b --- /dev/null +++ b/ext/standard/tests/file/move_uploaded_file_basic.phpt @@ -0,0 +1,79 @@ +--TEST-- +move_uploaded_file() function +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--POST_RAW-- +Content-type: multipart/form-data, boundary=AaB03x + +--AaB03x +content-disposition: form-data; name="field1" + +Joe Blow +--AaB03x +content-disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain + +abcdef123456789xxxDDDxxxDDDxxxDDD +--AaB03x +content-disposition: form-data; name="file2"; filename="file2.txt" +Content-Type: text/plain + +abcdef123456789 +--AaB03x-- +--FILE-- + +--EXPECTF-- +Valid move +bool(true) +bool(true) + +Original name of uploaded file +bool(false) +Non-uploaded source file +bool(false) +Valid move to existing file +bool(true) +Wrong parameters + +Warning: Wrong parameter count for move_uploaded_file() in %s on line %d +NULL + +Warning: Wrong parameter count for move_uploaded_file() in %s on line %d +NULL + + diff --git a/ext/standard/tests/file/parse_ini_file_variation1.phpt b/ext/standard/tests/file/parse_ini_file_variation1.phpt new file mode 100644 index 0000000000..a24bc1c051 --- /dev/null +++ b/ext/standard/tests/file/parse_ini_file_variation1.phpt @@ -0,0 +1,68 @@ +--TEST-- +Test parse_ini_file() function : variation: identical properties and values are not referenced. +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing parse_ini_file() : variation *** +array(2) { + ["section1"]=> + array(2) { + ["value1"]=> + string(8) "original" + ["value2"]=> + string(8) "original" + } + ["section2"]=> + array(2) { + ["value1"]=> + string(8) "original" + ["value2"]=> + string(9) "different" + } +} +array(2) { + ["section1"]=> + array(2) { + ["value1"]=> + string(7) "changed" + ["value2"]=> + string(8) "original" + } + ["section2"]=> + array(2) { + ["value1"]=> + string(8) "original" + ["value2"]=> + string(9) "different" + } +} +===DONE=== diff --git a/ext/standard/tests/file/parse_ini_file_variation2.phpt b/ext/standard/tests/file/parse_ini_file_variation2.phpt new file mode 100644 index 0000000000..20ad6bb067 --- /dev/null +++ b/ext/standard/tests/file/parse_ini_file_variation2.phpt @@ -0,0 +1,111 @@ +--TEST-- +Test parse_ini_file() function : variation: handling different boolean values +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing parse_ini_file() : variation *** +array(8) { + ["section1"]=> + array(2) { + ["value1"]=> + string(1) "1" + ["value2"]=> + string(0) "" + } + ["section2"]=> + array(2) { + ["value1"]=> + string(1) "1" + ["value2"]=> + string(0) "" + } + ["section3"]=> + array(2) { + ["value1"]=> + string(1) "1" + ["value2"]=> + string(0) "" + } + ["section4"]=> + array(2) { + ["value1"]=> + string(0) "" + ["value2"]=> + string(0) "" + } + ["section5"]=> + array(2) { + ["value1"]=> + string(2) "on" + ["value2"]=> + string(3) "off" + } + ["section6"]=> + array(2) { + ["value1"]=> + string(4) "true" + ["value2"]=> + string(5) "false" + } + ["section7"]=> + array(2) { + ["value1"]=> + string(3) "yes" + ["value2"]=> + string(2) "no" + } + ["section8"]=> + array(2) { + ["value1"]=> + string(4) "null" + ["value2"]=> + string(0) "" + } +} +===DONE=== diff --git a/ext/standard/tests/file/parse_ini_file_variation3.phpt b/ext/standard/tests/file/parse_ini_file_variation3.phpt new file mode 100644 index 0000000000..28a5b4562e --- /dev/null +++ b/ext/standard/tests/file/parse_ini_file_variation3.phpt @@ -0,0 +1,99 @@ +--TEST-- +Test parse_ini_file() function : variation: include path searching +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing parse_ini_file() : variation *** + +Warning: parse_ini_file(php.ini): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: parse_ini_file(php.ini): failed to open stream: No such file or directory in %s on line %d +bool(false) +array(11) { + ["error_reporting"]=> + string(4) "6143" + ["display_errors"]=> + string(1) "1" + ["display_startup_errors"]=> + string(0) "" + ["log_errors"]=> + string(0) "" + ["log_errors_max_len"]=> + string(4) "1024" + ["ignore_repeated_errors"]=> + string(0) "" + ["ignore_repeated_source"]=> + string(0) "" + ["report_memleaks"]=> + string(1) "1" + ["track_errors"]=> + string(0) "" + ["docref_root"]=> + string(11) "/phpmanual/" + ["docref_ext"]=> + string(5) ".html" +} +===DONE=== diff --git a/ext/standard/tests/file/parse_ini_file_variation4.phpt b/ext/standard/tests/file/parse_ini_file_variation4.phpt new file mode 100644 index 0000000000..5a5ebd5add --- /dev/null +++ b/ext/standard/tests/file/parse_ini_file_variation4.phpt @@ -0,0 +1,208 @@ +--TEST-- +Test parse_ini_file() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for filename + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( parse_ini_file($value, $process_sections) ); +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing parse_ini_file() : usage variation *** + +--int 0-- +Error: 2 - parse_ini_file(0): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--int 1-- +Error: 2 - parse_ini_file(1): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - parse_ini_file(12345): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - parse_ini_file(-2345): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - parse_ini_file(10.5): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - parse_ini_file(-10.5): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - parse_ini_file(123456789000): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - parse_ini_file(-123456789000): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float .5-- +Error: 2 - parse_ini_file(0.5): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--empty array-- +Error: 8 - Array to string conversion, %s(%d) +Error: 2 - parse_ini_file(Array): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--int indexed array-- +Error: 8 - Array to string conversion, %s(%d) +Error: 2 - parse_ini_file(Array): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--associative array-- +Error: 8 - Array to string conversion, %s(%d) +Error: 2 - parse_ini_file(Array): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--nested arrays-- +Error: 8 - Array to string conversion, %s(%d) +Error: 2 - parse_ini_file(Array): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--uppercase NULL-- +bool(false) + +--lowercase null-- +bool(false) + +--lowercase true-- +Error: 2 - parse_ini_file(1): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--lowercase false-- +bool(false) + +--uppercase TRUE-- +Error: 2 - parse_ini_file(1): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--uppercase FALSE-- +bool(false) + +--empty string DQ-- +bool(false) + +--empty string SQ-- +bool(false) + +--instance of classWithToString-- +Error: 2 - parse_ini_file(Class A object): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 4096 - Object of class classWithoutToString could not be converted to string, %s(%d) +Error: 8 - Object of class classWithoutToString to string conversion, %s(%d) +Error: 2 - parse_ini_file(Object): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--undefined var-- +bool(false) + +--unset var-- +bool(false) +===DONE=== diff --git a/ext/standard/tests/file/parse_ini_file_variation5.phpt b/ext/standard/tests/file/parse_ini_file_variation5.phpt new file mode 100644 index 0000000000..206969bdaa --- /dev/null +++ b/ext/standard/tests/file/parse_ini_file_variation5.phpt @@ -0,0 +1,265 @@ +--TEST-- +Test parse_ini_file() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for process_sections + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( parse_ini_file($filename, $value) ); +}; + +unlink($filename); +?> +===DONE=== +--EXPECTF-- +*** Testing parse_ini_file() : usage variation *** + +--int 0-- +array(1) { + ["a"]=> + string(4) "test" +} + +--int 1-- +array(1) { + ["a"]=> + string(4) "test" +} + +--int 12345-- +array(1) { + ["a"]=> + string(4) "test" +} + +--int -12345-- +array(1) { + ["a"]=> + string(4) "test" +} + +--float 10.5-- +array(1) { + ["a"]=> + string(4) "test" +} + +--float -10.5-- +array(1) { + ["a"]=> + string(4) "test" +} + +--float 12.3456789000e10-- +array(1) { + ["a"]=> + string(4) "test" +} + +--float -12.3456789000e10-- +array(1) { + ["a"]=> + string(4) "test" +} + +--float .5-- +array(1) { + ["a"]=> + string(4) "test" +} + +--empty array-- +array(1) { + ["a"]=> + string(4) "test" +} + +--int indexed array-- +array(1) { + ["a"]=> + string(4) "test" +} + +--associative array-- +array(1) { + ["a"]=> + string(4) "test" +} + +--nested arrays-- +array(1) { + ["a"]=> + string(4) "test" +} + +--uppercase NULL-- +array(1) { + ["a"]=> + string(4) "test" +} + +--lowercase null-- +array(1) { + ["a"]=> + string(4) "test" +} + +--empty string DQ-- +array(1) { + ["a"]=> + string(4) "test" +} + +--empty string SQ-- +array(1) { + ["a"]=> + string(4) "test" +} + +--string DQ-- +array(1) { + ["a"]=> + string(4) "test" +} + +--string SQ-- +array(1) { + ["a"]=> + string(4) "test" +} + +--mixed case string-- +array(1) { + ["a"]=> + string(4) "test" +} + +--heredoc-- +array(1) { + ["a"]=> + string(4) "test" +} + +--instance of classWithToString-- +array(1) { + ["a"]=> + string(4) "test" +} + +--instance of classWithoutToString-- +array(1) { + ["a"]=> + string(4) "test" +} + +--undefined var-- +array(1) { + ["a"]=> + string(4) "test" +} + +--unset var-- +array(1) { + ["a"]=> + string(4) "test" +} +===DONE=== diff --git a/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt b/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt new file mode 100644 index 0000000000..6dfbee990a --- /dev/null +++ b/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt @@ -0,0 +1,143 @@ +--TEST-- +Test parse_ini_file() function : variation - various absolute and relative paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing parse_ini_file() : variation *** + +-- Iteration 1 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 2 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 3 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 4 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 5 -- + +Warning: parse_ini_file(%sparseIniFileVar6.dir\parseIniFileVar6Sub\..\\\parseIniFileVar6Sub\\..\\..\parseIniFileVar6Sub\ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: parse_ini_file(%sparseIniFileVar6.dir\parseIniFileVar6Sub\BADDIR\ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 7 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 8 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 9 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 10 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 11 -- + +Warning: parse_ini_file(BADDIR\ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 12 -- +array(1) { + ["a"]=> + string(4) "test" +} + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/parse_ini_file_variation6.phpt b/ext/standard/tests/file/parse_ini_file_variation6.phpt new file mode 100644 index 0000000000..e9844e905a --- /dev/null +++ b/ext/standard/tests/file/parse_ini_file_variation6.phpt @@ -0,0 +1,129 @@ +--TEST-- +Test parse_ini_file() function : variation - various absolute and relative paths +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing parse_ini_file() : variation *** + +-- Iteration 1 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 2 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 3 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 4 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 5 -- + +Warning: parse_ini_file(%sparseIniFileVar6.dir/parseIniFileVar6Sub/..///parseIniFileVar6Sub//..//../parseIniFileVar6Sub/ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: parse_ini_file(%sparseIniFileVar6.dir/parseIniFileVar6Sub/BADDIR/ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +bool(false) + +-- Iteration 7 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 8 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 9 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 10 -- +array(1) { + ["a"]=> + string(4) "test" +} + +-- Iteration 11 -- + +Warning: parse_ini_file(BADDIR/ParseIniFileVar6.ini): failed to open stream: No such file or directory in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/pathinfo_basic1-win32.phpt b/ext/standard/tests/file/pathinfo_basic1-win32.phpt new file mode 100644 index 0000000000..9e84b99790 --- /dev/null +++ b/ext/standard/tests/file/pathinfo_basic1-win32.phpt @@ -0,0 +1,609 @@ +--TEST-- +Test pathinfo() function: basic functionality +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing basic functions of pathinfo() *** +-- Iteration 1 -- +string(0) "" +string(0) "" +string(0) "" +string(0) "" +array(2) { + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 2 -- +string(1) "." +string(1) " " +string(0) "" +string(1) " " +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(1) " " + ["filename"]=> + string(1) " " +} +-- Iteration 3 -- +string(2) "c:" +string(2) "c:" +string(0) "" +string(2) "c:" +array(3) { + ["dirname"]=> + string(2) "c:" + ["basename"]=> + string(2) "c:" + ["filename"]=> + string(2) "c:" +} +-- Iteration 4 -- +string(3) "c:\" +string(2) "c:" +string(0) "" +string(2) "c:" +array(3) { + ["dirname"]=> + string(3) "c:\" + ["basename"]=> + string(2) "c:" + ["filename"]=> + string(2) "c:" +} +-- Iteration 5 -- +string(3) "c:\" +string(2) "c:" +string(0) "" +string(2) "c:" +array(3) { + ["dirname"]=> + string(3) "c:\" + ["basename"]=> + string(2) "c:" + ["filename"]=> + string(2) "c:" +} +-- Iteration 6 -- +string(1) "." +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +-- Iteration 7 -- +string(7) "c:\test" +string(4) "adir" +string(0) "" +string(4) "adir" +array(3) { + ["dirname"]=> + string(7) "c:\test" + ["basename"]=> + string(4) "adir" + ["filename"]=> + string(4) "adir" +} +-- Iteration 8 -- +string(7) "c:\test" +string(4) "adir" +string(0) "" +string(4) "adir" +array(3) { + ["dirname"]=> + string(7) "c:\test" + ["basename"]=> + string(4) "adir" + ["filename"]=> + string(4) "adir" +} +-- Iteration 9 -- +string(12) "/usr/include" +string(4) "arpa" +string(0) "" +string(4) "arpa" +array(3) { + ["dirname"]=> + string(12) "/usr/include" + ["basename"]=> + string(4) "arpa" + ["filename"]=> + string(4) "arpa" +} +-- Iteration 10 -- +string(12) "/usr/include" +string(4) "arpa" +string(0) "" +string(4) "arpa" +array(3) { + ["dirname"]=> + string(12) "/usr/include" + ["basename"]=> + string(4) "arpa" + ["filename"]=> + string(4) "arpa" +} +-- Iteration 11 -- +string(11) "usr/include" +string(4) "arpa" +string(0) "" +string(4) "arpa" +array(3) { + ["dirname"]=> + string(11) "usr/include" + ["basename"]=> + string(4) "arpa" + ["filename"]=> + string(4) "arpa" +} +-- Iteration 12 -- +string(11) "usr/include" +string(4) "arpa" +string(0) "" +string(4) "arpa" +array(3) { + ["dirname"]=> + string(11) "usr/include" + ["basename"]=> + string(4) "arpa" + ["filename"]=> + string(4) "arpa" +} +-- Iteration 13 -- +string(7) "c:\test" +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(7) "c:\test" + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +-- Iteration 14 -- +string(7) "c:\test" +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(7) "c:\test" + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +-- Iteration 15 -- +string(8) "c://test" +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(8) "c://test" + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +-- Iteration 16 -- +string(7) "c:\test" +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(7) "c:\test" + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +-- Iteration 17 -- +string(7) "c:\test" +string(8) "prog.exe" +string(3) "exe" +string(4) "prog" +array(4) { + ["dirname"]=> + string(7) "c:\test" + ["basename"]=> + string(8) "prog.exe" + ["extension"]=> + string(3) "exe" + ["filename"]=> + string(4) "prog" +} +-- Iteration 18 -- +string(7) "c:\test" +string(8) "prog.exe" +string(3) "exe" +string(4) "prog" +array(4) { + ["dirname"]=> + string(7) "c:\test" + ["basename"]=> + string(8) "prog.exe" + ["extension"]=> + string(3) "exe" + ["filename"]=> + string(4) "prog" +} +-- Iteration 19 -- +string(7) "c:/test" +string(8) "prog.exe" +string(3) "exe" +string(4) "prog" +array(4) { + ["dirname"]=> + string(7) "c:/test" + ["basename"]=> + string(8) "prog.exe" + ["extension"]=> + string(3) "exe" + ["filename"]=> + string(4) "prog" +} +-- Iteration 20 -- +string(17) "/usr/include/arpa" +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 21 -- +string(19) "//usr/include//arpa" +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(19) "//usr/include//arpa" + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 22 -- +string(1) "\" +string(0) "" +string(0) "" +string(0) "" +array(3) { + ["dirname"]=> + string(1) "\" + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 23 -- +string(1) "\" +string(0) "" +string(0) "" +string(0) "" +array(3) { + ["dirname"]=> + string(1) "\" + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 24 -- +string(1) "\" +string(0) "" +string(0) "" +string(0) "" +array(3) { + ["dirname"]=> + string(1) "\" + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 25 -- +string(1) "\" +string(0) "" +string(0) "" +string(0) "" +array(3) { + ["dirname"]=> + string(1) "\" + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 26 -- +string(1) "\" +string(0) "" +string(0) "" +string(0) "" +array(3) { + ["dirname"]=> + string(1) "\" + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 27 -- +string(17) "/usr/include/arpa" +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 28 -- +string(31) "c:\windows/system32\drivers/etc" +string(5) "hosts" +string(0) "" +string(5) "hosts" +array(3) { + ["dirname"]=> + string(31) "c:\windows/system32\drivers/etc" + ["basename"]=> + string(5) "hosts" + ["filename"]=> + string(5) "hosts" +} +-- Iteration 29 -- +string(17) "/usr\include/arpa" +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(17) "/usr\include/arpa" + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 30 -- +string(15) " c:\test\adir" +string(9) "afile.txt" +string(3) "txt" +string(5) "afile" +array(4) { + ["dirname"]=> + string(15) " c:\test\adir" + ["basename"]=> + string(9) "afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(5) "afile" +} +-- Iteration 31 -- +string(12) "c:\test\adir" +string(12) "afile.txt " +string(6) "txt " +string(5) "afile" +array(4) { + ["dirname"]=> + string(12) "c:\test\adir" + ["basename"]=> + string(12) "afile.txt " + ["extension"]=> + string(6) "txt " + ["filename"]=> + string(5) "afile" +} +-- Iteration 32 -- +string(15) " c:\test\adir" +string(12) "afile.txt " +string(6) "txt " +string(5) "afile" +array(4) { + ["dirname"]=> + string(15) " c:\test\adir" + ["basename"]=> + string(12) "afile.txt " + ["extension"]=> + string(6) "txt " + ["filename"]=> + string(5) "afile" +} +-- Iteration 33 -- +string(20) " /usr/include/arpa" +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(20) " /usr/include/arpa" + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 34 -- +string(17) "/usr/include/arpa" +string(9) "inet.h " +string(4) "h " +string(4) "inet" +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(9) "inet.h " + ["extension"]=> + string(4) "h " + ["filename"]=> + string(4) "inet" +} +-- Iteration 35 -- +string(20) " /usr/include/arpa" +string(9) "inet.h " +string(4) "h " +string(4) "inet" +array(4) { + ["dirname"]=> + string(20) " /usr/include/arpa" + ["basename"]=> + string(9) "inet.h " + ["extension"]=> + string(4) "h " + ["filename"]=> + string(4) "inet" +} +-- Iteration 36 -- +string(1) "." +string(3) " c:" +string(0) "" +string(3) " c:" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(3) " c:" + ["filename"]=> + string(3) " c:" +} +-- Iteration 37 -- +string(14) " c:\test\adir" +string(9) "afile.txt" +string(3) "txt" +string(5) "afile" +array(4) { + ["dirname"]=> + string(14) " c:\test\adir" + ["basename"]=> + string(9) "afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(5) "afile" +} +-- Iteration 38 -- +string(1) "\" +string(3) "usr" +string(0) "" +string(3) "usr" +array(3) { + ["dirname"]=> + string(1) "\" + ["basename"]=> + string(3) "usr" + ["filename"]=> + string(3) "usr" +} +-- Iteration 39 -- +string(1) "\" +string(3) "usr" +string(0) "" +string(3) "usr" +array(3) { + ["dirname"]=> + string(1) "\" + ["basename"]=> + string(3) "usr" + ["filename"]=> + string(3) "usr" +} +Done diff --git a/ext/standard/tests/file/pathinfo_basic1.phpt b/ext/standard/tests/file/pathinfo_basic1.phpt new file mode 100644 index 0000000000..61b183f870 --- /dev/null +++ b/ext/standard/tests/file/pathinfo_basic1.phpt @@ -0,0 +1,609 @@ +--TEST-- +Test pathinfo() function: basic functionality +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing basic functions of pathinfo() *** +-- Iteration 1 -- +string(0) "" +string(0) "" +string(0) "" +string(0) "" +array(2) { + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 2 -- +string(1) "." +string(1) " " +string(0) "" +string(1) " " +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(1) " " + ["filename"]=> + string(1) " " +} +-- Iteration 3 -- +string(1) "." +string(2) "c:" +string(0) "" +string(2) "c:" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(2) "c:" + ["filename"]=> + string(2) "c:" +} +-- Iteration 4 -- +string(1) "." +string(3) "c:\" +string(0) "" +string(3) "c:\" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(3) "c:\" + ["filename"]=> + string(3) "c:\" +} +-- Iteration 5 -- +string(1) "." +string(2) "c:" +string(0) "" +string(2) "c:" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(2) "c:" + ["filename"]=> + string(2) "c:" +} +-- Iteration 6 -- +string(1) "." +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +-- Iteration 7 -- +string(1) "." +string(12) "c:\test\adir" +string(0) "" +string(12) "c:\test\adir" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(12) "c:\test\adir" + ["filename"]=> + string(12) "c:\test\adir" +} +-- Iteration 8 -- +string(1) "." +string(13) "c:\test\adir\" +string(0) "" +string(13) "c:\test\adir\" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(13) "c:\test\adir\" + ["filename"]=> + string(13) "c:\test\adir\" +} +-- Iteration 9 -- +string(12) "/usr/include" +string(4) "arpa" +string(0) "" +string(4) "arpa" +array(3) { + ["dirname"]=> + string(12) "/usr/include" + ["basename"]=> + string(4) "arpa" + ["filename"]=> + string(4) "arpa" +} +-- Iteration 10 -- +string(12) "/usr/include" +string(4) "arpa" +string(0) "" +string(4) "arpa" +array(3) { + ["dirname"]=> + string(12) "/usr/include" + ["basename"]=> + string(4) "arpa" + ["filename"]=> + string(4) "arpa" +} +-- Iteration 11 -- +string(11) "usr/include" +string(4) "arpa" +string(0) "" +string(4) "arpa" +array(3) { + ["dirname"]=> + string(11) "usr/include" + ["basename"]=> + string(4) "arpa" + ["filename"]=> + string(4) "arpa" +} +-- Iteration 12 -- +string(11) "usr/include" +string(4) "arpa" +string(0) "" +string(4) "arpa" +array(3) { + ["dirname"]=> + string(11) "usr/include" + ["basename"]=> + string(4) "arpa" + ["filename"]=> + string(4) "arpa" +} +-- Iteration 13 -- +string(1) "." +string(13) "c:\test\afile" +string(0) "" +string(13) "c:\test\afile" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(13) "c:\test\afile" + ["filename"]=> + string(13) "c:\test\afile" +} +-- Iteration 14 -- +string(1) "." +string(13) "c:\test\afile" +string(0) "" +string(13) "c:\test\afile" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(13) "c:\test\afile" + ["filename"]=> + string(13) "c:\test\afile" +} +-- Iteration 15 -- +string(8) "c://test" +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(8) "c://test" + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +-- Iteration 16 -- +string(1) "." +string(14) "c:\test\afile\" +string(0) "" +string(14) "c:\test\afile\" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(14) "c:\test\afile\" + ["filename"]=> + string(14) "c:\test\afile\" +} +-- Iteration 17 -- +string(1) "." +string(16) "c:\test\prog.exe" +string(3) "exe" +string(12) "c:\test\prog" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(16) "c:\test\prog.exe" + ["extension"]=> + string(3) "exe" + ["filename"]=> + string(12) "c:\test\prog" +} +-- Iteration 18 -- +string(1) "." +string(16) "c:\test\prog.exe" +string(3) "exe" +string(12) "c:\test\prog" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(16) "c:\test\prog.exe" + ["extension"]=> + string(3) "exe" + ["filename"]=> + string(12) "c:\test\prog" +} +-- Iteration 19 -- +string(7) "c:/test" +string(8) "prog.exe" +string(3) "exe" +string(4) "prog" +array(4) { + ["dirname"]=> + string(7) "c:/test" + ["basename"]=> + string(8) "prog.exe" + ["extension"]=> + string(3) "exe" + ["filename"]=> + string(4) "prog" +} +-- Iteration 20 -- +string(17) "/usr/include/arpa" +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 21 -- +string(19) "//usr/include//arpa" +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(19) "//usr/include//arpa" + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 22 -- +string(1) "." +string(1) "\" +string(0) "" +string(1) "\" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(1) "\" + ["filename"]=> + string(1) "\" +} +-- Iteration 23 -- +string(1) "." +string(2) "\\" +string(0) "" +string(2) "\\" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(2) "\\" + ["filename"]=> + string(2) "\\" +} +-- Iteration 24 -- +string(1) "/" +string(0) "" +string(0) "" +string(0) "" +array(3) { + ["dirname"]=> + string(1) "/" + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 25 -- +string(1) "/" +string(0) "" +string(0) "" +string(0) "" +array(3) { + ["dirname"]=> + string(1) "/" + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 26 -- +string(1) "/" +string(0) "" +string(0) "" +string(0) "" +array(3) { + ["dirname"]=> + string(1) "/" + ["basename"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 27 -- +string(17) "/usr/include/arpa" +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 28 -- +string(27) "c:\windows/system32\drivers" +string(9) "etc\hosts" +string(0) "" +string(9) "etc\hosts" +array(3) { + ["dirname"]=> + string(27) "c:\windows/system32\drivers" + ["basename"]=> + string(9) "etc\hosts" + ["filename"]=> + string(9) "etc\hosts" +} +-- Iteration 29 -- +string(12) "/usr\include" +string(11) "arpa\inet.h" +string(1) "h" +string(9) "arpa\inet" +array(4) { + ["dirname"]=> + string(12) "/usr\include" + ["basename"]=> + string(11) "arpa\inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(9) "arpa\inet" +} +-- Iteration 30 -- +string(1) "." +string(25) " c:\test\adir\afile.txt" +string(3) "txt" +string(21) " c:\test\adir\afile" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(25) " c:\test\adir\afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(21) " c:\test\adir\afile" +} +-- Iteration 31 -- +string(1) "." +string(25) "c:\test\adir\afile.txt " +string(6) "txt " +string(18) "c:\test\adir\afile" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(25) "c:\test\adir\afile.txt " + ["extension"]=> + string(6) "txt " + ["filename"]=> + string(18) "c:\test\adir\afile" +} +-- Iteration 32 -- +string(1) "." +string(28) " c:\test\adir\afile.txt " +string(6) "txt " +string(21) " c:\test\adir\afile" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(28) " c:\test\adir\afile.txt " + ["extension"]=> + string(6) "txt " + ["filename"]=> + string(21) " c:\test\adir\afile" +} +-- Iteration 33 -- +string(20) " /usr/include/arpa" +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(20) " /usr/include/arpa" + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 34 -- +string(17) "/usr/include/arpa" +string(9) "inet.h " +string(4) "h " +string(4) "inet" +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(9) "inet.h " + ["extension"]=> + string(4) "h " + ["filename"]=> + string(4) "inet" +} +-- Iteration 35 -- +string(20) " /usr/include/arpa" +string(9) "inet.h " +string(4) "h " +string(4) "inet" +array(4) { + ["dirname"]=> + string(20) " /usr/include/arpa" + ["basename"]=> + string(9) "inet.h " + ["extension"]=> + string(4) "h " + ["filename"]=> + string(4) "inet" +} +-- Iteration 36 -- +string(1) "." +string(3) " c:" +string(0) "" +string(3) " c:" +array(3) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(3) " c:" + ["filename"]=> + string(3) " c:" +} +-- Iteration 37 -- +string(1) "." +string(24) " c:\test\adir\afile.txt" +string(3) "txt" +string(20) " c:\test\adir\afile" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(24) " c:\test\adir\afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(20) " c:\test\adir\afile" +} +-- Iteration 38 -- +string(1) "/" +string(3) "usr" +string(0) "" +string(3) "usr" +array(3) { + ["dirname"]=> + string(1) "/" + ["basename"]=> + string(3) "usr" + ["filename"]=> + string(3) "usr" +} +-- Iteration 39 -- +string(1) "/" +string(3) "usr" +string(0) "" +string(3) "usr" +array(3) { + ["dirname"]=> + string(1) "/" + ["basename"]=> + string(3) "usr" + ["filename"]=> + string(3) "usr" +} +Done \ No newline at end of file diff --git a/ext/standard/tests/file/pathinfo_basic2-win32.phpt b/ext/standard/tests/file/pathinfo_basic2-win32.phpt new file mode 100644 index 0000000000..c88bc25ffc --- /dev/null +++ b/ext/standard/tests/file/pathinfo_basic2-win32.phpt @@ -0,0 +1,270 @@ +--TEST-- +Test pathinfo() function: basic functionality +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECT-- +*** Testing basic functions of pathinfo() *** +-- Iteration 1 -- +string(5) "c:\.." +string(4) "dir1" +string(0) "" +string(4) "dir1" +array(3) { + ["dirname"]=> + string(5) "c:\.." + ["basename"]=> + string(4) "dir1" + ["filename"]=> + string(4) "dir1" +} +-- Iteration 2 -- +string(23) "c:\test\..\test2\.\adir" +string(9) "afile.txt" +string(3) "txt" +string(5) "afile" +array(4) { + ["dirname"]=> + string(23) "c:\test\..\test2\.\adir" + ["basename"]=> + string(9) "afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(5) "afile" +} +-- Iteration 3 -- +string(22) "/usr/include/../arpa/." +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(22) "/usr/include/../arpa/." + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 4 -- +string(12) "c:\test\adir" +string(10) "afile..txt" +string(3) "txt" +string(6) "afile." +array(4) { + ["dirname"]=> + string(12) "c:\test\adir" + ["basename"]=> + string(10) "afile..txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(6) "afile." +} +-- Iteration 5 -- +string(17) "/usr/include/arpa" +string(7) "inet..h" +string(1) "h" +string(5) "inet." +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(7) "inet..h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(5) "inet." +} +-- Iteration 6 -- +string(12) "c:\test\adir" +string(6) "afile." +string(0) "" +string(5) "afile" +array(4) { + ["dirname"]=> + string(12) "c:\test\adir" + ["basename"]=> + string(6) "afile." + ["extension"]=> + string(0) "" + ["filename"]=> + string(5) "afile" +} +-- Iteration 7 -- +string(17) "/usr/include/arpa" +string(5) "inet." +string(0) "" +string(4) "inet" +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(5) "inet." + ["extension"]=> + string(0) "" + ["filename"]=> + string(4) "inet" +} +-- Iteration 8 -- +string(17) "/usr/include/arpa" +string(6) "inet,h" +string(0) "" +string(6) "inet,h" +array(3) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(6) "inet,h" + ["filename"]=> + string(6) "inet,h" +} +-- Iteration 9 -- +string(3) "c:." +string(11) "c:afile.txt" +string(3) "txt" +string(7) "c:afile" +array(4) { + ["dirname"]=> + string(3) "c:." + ["basename"]=> + string(11) "c:afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(7) "c:afile" +} +-- Iteration 10 -- +string(12) "..\.\..\test" +string(9) "afile.txt" +string(3) "txt" +string(5) "afile" +array(4) { + ["dirname"]=> + string(12) "..\.\..\test" + ["basename"]=> + string(9) "afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(5) "afile" +} +-- Iteration 11 -- +string(12) ".././../test" +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(12) ".././../test" + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +-- Iteration 12 -- +string(1) "." +string(1) "." +string(0) "" +string(0) "" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(1) "." + ["extension"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 13 -- +string(1) "." +string(2) ".." +string(0) "" +string(1) "." +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(2) ".." + ["extension"]=> + string(0) "" + ["filename"]=> + string(1) "." +} +-- Iteration 14 -- +string(1) "." +string(3) "..." +string(0) "" +string(2) ".." +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(3) "..." + ["extension"]=> + string(0) "" + ["filename"]=> + string(2) ".." +} +-- Iteration 15 -- +string(12) "/usr/lib/..." +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(12) "/usr/lib/..." + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +Done \ No newline at end of file diff --git a/ext/standard/tests/file/pathinfo_basic2.phpt b/ext/standard/tests/file/pathinfo_basic2.phpt new file mode 100644 index 0000000000..7bddda039b --- /dev/null +++ b/ext/standard/tests/file/pathinfo_basic2.phpt @@ -0,0 +1,272 @@ +--TEST-- +Test pathinfo() function: basic functionality +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECT-- +*** Testing basic functions of pathinfo() *** +-- Iteration 1 -- +string(1) "." +string(10) "c:\..\dir1" +string(5) "\dir1" +string(4) "c:\." +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(10) "c:\..\dir1" + ["extension"]=> + string(5) "\dir1" + ["filename"]=> + string(4) "c:\." +} +-- Iteration 2 -- +string(1) "." +string(33) "c:\test\..\test2\.\adir\afile.txt" +string(3) "txt" +string(29) "c:\test\..\test2\.\adir\afile" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(33) "c:\test\..\test2\.\adir\afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(29) "c:\test\..\test2\.\adir\afile" +} +-- Iteration 3 -- +string(22) "/usr/include/../arpa/." +string(6) "inet.h" +string(1) "h" +string(4) "inet" +array(4) { + ["dirname"]=> + string(22) "/usr/include/../arpa/." + ["basename"]=> + string(6) "inet.h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(4) "inet" +} +-- Iteration 4 -- +string(1) "." +string(23) "c:\test\adir\afile..txt" +string(3) "txt" +string(19) "c:\test\adir\afile." +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(23) "c:\test\adir\afile..txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(19) "c:\test\adir\afile." +} +-- Iteration 5 -- +string(17) "/usr/include/arpa" +string(7) "inet..h" +string(1) "h" +string(5) "inet." +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(7) "inet..h" + ["extension"]=> + string(1) "h" + ["filename"]=> + string(5) "inet." +} +-- Iteration 6 -- +string(1) "." +string(19) "c:\test\adir\afile." +string(0) "" +string(18) "c:\test\adir\afile" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(19) "c:\test\adir\afile." + ["extension"]=> + string(0) "" + ["filename"]=> + string(18) "c:\test\adir\afile" +} +-- Iteration 7 -- +string(17) "/usr/include/arpa" +string(5) "inet." +string(0) "" +string(4) "inet" +array(4) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(5) "inet." + ["extension"]=> + string(0) "" + ["filename"]=> + string(4) "inet" +} +-- Iteration 8 -- +string(17) "/usr/include/arpa" +string(6) "inet,h" +string(0) "" +string(6) "inet,h" +array(3) { + ["dirname"]=> + string(17) "/usr/include/arpa" + ["basename"]=> + string(6) "inet,h" + ["filename"]=> + string(6) "inet,h" +} +-- Iteration 9 -- +string(1) "." +string(11) "c:afile.txt" +string(3) "txt" +string(7) "c:afile" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(11) "c:afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(7) "c:afile" +} +-- Iteration 10 -- +string(1) "." +string(22) "..\.\..\test\afile.txt" +string(3) "txt" +string(18) "..\.\..\test\afile" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(22) "..\.\..\test\afile.txt" + ["extension"]=> + string(3) "txt" + ["filename"]=> + string(18) "..\.\..\test\afile" +} +-- Iteration 11 -- +string(12) ".././../test" +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(12) ".././../test" + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +-- Iteration 12 -- +string(1) "." +string(1) "." +string(0) "" +string(0) "" +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(1) "." + ["extension"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +-- Iteration 13 -- +string(1) "." +string(2) ".." +string(0) "" +string(1) "." +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(2) ".." + ["extension"]=> + string(0) "" + ["filename"]=> + string(1) "." +} +-- Iteration 14 -- +string(1) "." +string(3) "..." +string(0) "" +string(2) ".." +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(3) "..." + ["extension"]=> + string(0) "" + ["filename"]=> + string(2) ".." +} +-- Iteration 15 -- +string(12) "/usr/lib/..." +string(5) "afile" +string(0) "" +string(5) "afile" +array(3) { + ["dirname"]=> + string(12) "/usr/lib/..." + ["basename"]=> + string(5) "afile" + ["filename"]=> + string(5) "afile" +} +Done \ No newline at end of file diff --git a/ext/standard/tests/file/pathinfo_variation1.phpt b/ext/standard/tests/file/pathinfo_variation1.phpt new file mode 100644 index 0000000000..ff4c1eb818 --- /dev/null +++ b/ext/standard/tests/file/pathinfo_variation1.phpt @@ -0,0 +1,190 @@ +--TEST-- +Test pathinfo() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for path + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( pathinfo($value, $options) ); +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing pathinfo() : usage variation *** + +--int 0-- +string(1) "." + +--int 1-- +string(1) "." + +--int 12345-- +string(1) "." + +--int -12345-- +string(1) "." + +--float 10.5-- +string(1) "." + +--float -10.5-- +string(1) "." + +--float 12.3456789000e10-- +string(1) "." + +--float -12.3456789000e10-- +string(1) "." + +--float .5-- +string(1) "." + +--empty array-- +Error: 2 - pathinfo() expects parameter 1 to be string, array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - pathinfo() expects parameter 1 to be string, array given, %s(%d) +NULL + +--associative array-- +Error: 2 - pathinfo() expects parameter 1 to be string, array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - pathinfo() expects parameter 1 to be string, array given, %s(%d) +NULL + +--uppercase NULL-- +string(0) "" + +--lowercase null-- +string(0) "" + +--lowercase true-- +string(1) "." + +--lowercase false-- +string(0) "" + +--uppercase TRUE-- +string(1) "." + +--uppercase FALSE-- +string(0) "" + +--empty string DQ-- +string(0) "" + +--empty string SQ-- +string(0) "" + +--instance of classWithToString-- +string(1) "." + +--instance of classWithoutToString-- +Error: 2 - pathinfo() expects parameter 1 to be string, object given, %s(%d) +NULL + +--undefined var-- +string(0) "" + +--unset var-- +string(0) "" +===DONE=== diff --git a/ext/standard/tests/file/pathinfo_variation2.phpt b/ext/standard/tests/file/pathinfo_variation2.phpt new file mode 100644 index 0000000000..9d18a4b79d --- /dev/null +++ b/ext/standard/tests/file/pathinfo_variation2.phpt @@ -0,0 +1,197 @@ +--TEST-- +Test pathinfo() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for options + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( pathinfo($path, $value) ); +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing pathinfo() : usage variation *** + +--float 10.5-- +string(6) "inet.h" + +--float -10.5-- +string(6) "inet.h" + +--float 12.3456789000e10-- +string(%d) %s + +--float -12.3456789000e10-- +string(%d) %s + +--float .5-- +string(%d) %s + +--empty array-- +Error: 2 - pathinfo() expects parameter 2 to be long, array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - pathinfo() expects parameter 2 to be long, array given, %s(%d) +NULL + +--associative array-- +Error: 2 - pathinfo() expects parameter 2 to be long, array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - pathinfo() expects parameter 2 to be long, array given, %s(%d) +NULL + +--uppercase NULL-- +string(0) "" + +--lowercase null-- +string(0) "" + +--lowercase true-- +string(17) "/usr/include/arpa" + +--lowercase false-- +string(0) "" + +--uppercase TRUE-- +string(17) "/usr/include/arpa" + +--uppercase FALSE-- +string(0) "" + +--empty string DQ-- +Error: 2 - pathinfo() expects parameter 2 to be long, string given, %s(%d) +NULL + +--empty string SQ-- +Error: 2 - pathinfo() expects parameter 2 to be long, string given, %s(%d) +NULL + +--string DQ-- +Error: 2 - pathinfo() expects parameter 2 to be long, string given, %s(%d) +NULL + +--string SQ-- +Error: 2 - pathinfo() expects parameter 2 to be long, string given, %s(%d) +NULL + +--mixed case string-- +Error: 2 - pathinfo() expects parameter 2 to be long, string given, %s(%d) +NULL + +--heredoc-- +Error: 2 - pathinfo() expects parameter 2 to be long, string given, %s(%d) +NULL + +--instance of classWithToString-- +Error: 2 - pathinfo() expects parameter 2 to be long, object given, %s(%d) +NULL + +--instance of classWithoutToString-- +Error: 2 - pathinfo() expects parameter 2 to be long, object given, %s(%d) +NULL + +--undefined var-- +string(0) "" + +--unset var-- +string(0) "" +===DONE=== diff --git a/ext/standard/tests/file/pathinfo_variation3.phpt b/ext/standard/tests/file/pathinfo_variation3.phpt new file mode 100644 index 0000000000..333aa56838 --- /dev/null +++ b/ext/standard/tests/file/pathinfo_variation3.phpt @@ -0,0 +1,80 @@ +--TEST-- +Test pathinfo() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing pathinfo() : usage variation *** +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(1) "." + ["extension"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +array(4) { + ["dirname"]=> + string(1) "%s" + ["basename"]=> + string(1) "." + ["extension"]=> + string(0) "" + ["filename"]=> + string(0) "" +} +array(4) { + ["dirname"]=> + string(1) "." + ["basename"]=> + string(10) ".cvsignore" + ["extension"]=> + string(9) "cvsignore" + ["filename"]=> + string(0) "" +} +string(6) "inet.h" +string(4) "inet" +string(1) "h" +string(17) "/usr/include/arpa" +string(17) "/usr/include/arpa" +string(6) "inet.h" +string(1) "h" +string(6) "inet.h" +string(17) "/usr/include/arpa" +string(6) "inet.h" +string(17) "/usr/include/arpa" +string(17) "/usr/include/arpa" +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/pclose_variation1.phpt b/ext/standard/tests/file/pclose_variation1.phpt new file mode 100644 index 0000000000..38c7f09a18 --- /dev/null +++ b/ext/standard/tests/file/pclose_variation1.phpt @@ -0,0 +1,231 @@ +--TEST-- +Test pclose() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for fp + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( pclose($value) ); +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing pclose() : usage variation *** + +--int 0-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--int 1-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--float .5-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--empty array-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--associative array-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--uppercase NULL-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--string DQ-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--string SQ-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--mixed case string-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--heredoc-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--instance of classWithToString-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--undefined var-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) + +--unset var-- +Error: 2 - pclose(): supplied argument is not a valid stream resource, %s(%d) +bool(false) +===DONE=== diff --git a/ext/standard/tests/file/popen_pclose_error-sunos.phpt b/ext/standard/tests/file/popen_pclose_error-sunos.phpt index d2de737cff..b63dbeb7ea 100644 --- a/ext/standard/tests/file/popen_pclose_error-sunos.phpt +++ b/ext/standard/tests/file/popen_pclose_error-sunos.phpt @@ -40,8 +40,8 @@ NULL Warning: Wrong parameter count for popen() in %s on line %d NULL -resource(%d) of type (stream) sh: abc.txt: not found +resource(%d) of type (stream) Warning: Wrong parameter count for pclose() in %s on line %d NULL diff --git a/ext/standard/tests/file/readfile_variation10-win32.phpt b/ext/standard/tests/file/readfile_variation10-win32.phpt new file mode 100644 index 0000000000..6fa905ac0b --- /dev/null +++ b/ext/standard/tests/file/readfile_variation10-win32.phpt @@ -0,0 +1,72 @@ +--TEST-- +Test readfile() function : variation - various invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing readfile() : variation *** +-- testing '-1' -- + +Warning: readfile(-1): failed to open stream: No such file or directory in %s on line %d +-- testing '1' -- + +Warning: readfile(1): failed to open stream: No such file or directory in %s on line %d +-- testing '' -- +-- testing '' -- +-- testing '' -- +-- testing ' ' -- + +Warning: readfile( ): failed to open stream: Permission denied in %s on line %d +-- testing '%s' -- +-- testing 'Array' -- + +Warning: readfile() expects parameter 1 to be string, array given in %s on line %d +-- testing '/no/such/file/dir' -- + +Warning: readfile(/no/such/file/dir): failed to open stream: No such file or directory in %s on line %d +-- testing 'php/php' -- + +Warning: readfile(php/php): failed to open stream: No such file or directory in %s on line %d + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/readfile_variation10.phpt b/ext/standard/tests/file/readfile_variation10.phpt new file mode 100644 index 0000000000..3ee1a906b7 --- /dev/null +++ b/ext/standard/tests/file/readfile_variation10.phpt @@ -0,0 +1,72 @@ +--TEST-- +Test readfile() function : variation - various invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing readfile() : variation *** +-- testing '-1' -- + +Warning: readfile(-1): failed to open stream: No such file or directory in %s on line %d +-- testing '1' -- + +Warning: readfile(1): failed to open stream: No such file or directory in %s on line %d +-- testing '' -- +-- testing '' -- +-- testing '' -- +-- testing ' ' -- + +Warning: readfile( ): failed to open stream: No such file or directory in %s on line %d +-- testing '%s' -- +-- testing 'Array' -- + +Warning: readfile() expects parameter 1 to be string, array given in %s on line %d +-- testing '/no/such/file/dir' -- + +Warning: readfile(/no/such/file/dir): failed to open stream: No such file or directory in %s on line %d +-- testing 'php/php' -- + +Warning: readfile(php/php): failed to open stream: %s directory in %s on line %d + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/readfile_variation4.phpt b/ext/standard/tests/file/readfile_variation4.phpt new file mode 100644 index 0000000000..94b3326b56 --- /dev/null +++ b/ext/standard/tests/file/readfile_variation4.phpt @@ -0,0 +1,251 @@ +--TEST-- +Test readfile() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // file resource + 'file resource' => $fileRes, +); + +// loop through each element of the array for context + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $h = readfile($filename, $use_include_path, $value); + if ($h == false) { + echo "file not read\n"; + } + else { + echo "\n"; + } +}; + +unlink($filename); +fclose($fileRes); + +?> +===DONE=== +--EXPECTF-- +*** Testing readfile() : usage variation *** + +--int 0-- +Error: 2 - readfile() expects parameter 3 to be resource, integer given, %s(%d) +file not read + +--int 1-- +Error: 2 - readfile() expects parameter 3 to be resource, integer given, %s(%d) +file not read + +--int 12345-- +Error: 2 - readfile() expects parameter 3 to be resource, integer given, %s(%d) +file not read + +--int -12345-- +Error: 2 - readfile() expects parameter 3 to be resource, integer given, %s(%d) +file not read + +--float 10.5-- +Error: 2 - readfile() expects parameter 3 to be resource, double given, %s(%d) +file not read + +--float -10.5-- +Error: 2 - readfile() expects parameter 3 to be resource, double given, %s(%d) +file not read + +--float 12.3456789000e10-- +Error: 2 - readfile() expects parameter 3 to be resource, double given, %s(%d) +file not read + +--float -12.3456789000e10-- +Error: 2 - readfile() expects parameter 3 to be resource, double given, %s(%d) +file not read + +--float .5-- +Error: 2 - readfile() expects parameter 3 to be resource, double given, %s(%d) +file not read + +--empty array-- +Error: 2 - readfile() expects parameter 3 to be resource, array given, %s(%d) +file not read + +--int indexed array-- +Error: 2 - readfile() expects parameter 3 to be resource, array given, %s(%d) +file not read + +--associative array-- +Error: 2 - readfile() expects parameter 3 to be resource, array given, %s(%d) +file not read + +--nested arrays-- +Error: 2 - readfile() expects parameter 3 to be resource, array given, %s(%d) +file not read + +--uppercase NULL-- +testing readfile + +--lowercase null-- +testing readfile + +--lowercase true-- +Error: 2 - readfile() expects parameter 3 to be resource, boolean given, %s(%d) +file not read + +--lowercase false-- +Error: 2 - readfile() expects parameter 3 to be resource, boolean given, %s(%d) +file not read + +--uppercase TRUE-- +Error: 2 - readfile() expects parameter 3 to be resource, boolean given, %s(%d) +file not read + +--uppercase FALSE-- +Error: 2 - readfile() expects parameter 3 to be resource, boolean given, %s(%d) +file not read + +--empty string DQ-- +Error: 2 - readfile() expects parameter 3 to be resource, string given, %s(%d) +file not read + +--empty string SQ-- +Error: 2 - readfile() expects parameter 3 to be resource, string given, %s(%d) +file not read + +--string DQ-- +Error: 2 - readfile() expects parameter 3 to be resource, string given, %s(%d) +file not read + +--string SQ-- +Error: 2 - readfile() expects parameter 3 to be resource, string given, %s(%d) +file not read + +--mixed case string-- +Error: 2 - readfile() expects parameter 3 to be resource, string given, %s(%d) +file not read + +--heredoc-- +Error: 2 - readfile() expects parameter 3 to be resource, string given, %s(%d) +file not read + +--instance of classWithToString-- +Error: 2 - readfile() expects parameter 3 to be resource, object given, %s(%d) +file not read + +--instance of classWithoutToString-- +Error: 2 - readfile() expects parameter 3 to be resource, object given, %s(%d) +file not read + +--undefined var-- +testing readfile + +--unset var-- +testing readfile + +--file resource-- +Error: 2 - readfile(): supplied resource is not a valid Stream-Context resource, %s(%d) +testing readfile +===DONE=== diff --git a/ext/standard/tests/file/readfile_variation5.phpt b/ext/standard/tests/file/readfile_variation5.phpt new file mode 100644 index 0000000000..21856f8135 --- /dev/null +++ b/ext/standard/tests/file/readfile_variation5.phpt @@ -0,0 +1,221 @@ +--TEST-- +Test readfile() function : usage variation +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for use_include_path + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $res = readfile($filename, $value); + if ($res == false) { + echo "File not read\n"; + } + else { + echo "\n"; + } +}; + +unlink($filename); + +?> +===DONE=== +--EXPECTF-- +*** Testing readfile() : usage variation *** + +--int 0-- +testing readfile + +--int 1-- +testing readfile + +--int 12345-- +testing readfile + +--int -12345-- +testing readfile + +--float 10.5-- +testing readfile + +--float -10.5-- +testing readfile + +--float 12.3456789000e10-- +testing readfile + +--float -12.3456789000e10-- +testing readfile + +--float .5-- +testing readfile + +--empty array-- +Error: 2 - readfile() expects parameter 2 to be boolean, array given, %s(%d) +File not read + +--int indexed array-- +Error: 2 - readfile() expects parameter 2 to be boolean, array given, %s(%d) +File not read + +--associative array-- +Error: 2 - readfile() expects parameter 2 to be boolean, array given, %s(%d) +File not read + +--nested arrays-- +Error: 2 - readfile() expects parameter 2 to be boolean, array given, %s(%d) +File not read + +--uppercase NULL-- +testing readfile + +--lowercase null-- +testing readfile + +--lowercase true-- +testing readfile + +--lowercase false-- +testing readfile + +--uppercase TRUE-- +testing readfile + +--uppercase FALSE-- +testing readfile + +--empty string DQ-- +testing readfile + +--empty string SQ-- +testing readfile + +--string DQ-- +testing readfile + +--string SQ-- +testing readfile + +--mixed case string-- +testing readfile + +--heredoc-- +testing readfile + +--instance of classWithToString-- +Error: 2 - readfile() expects parameter 2 to be boolean, object given, %s(%d) +File not read + +--instance of classWithoutToString-- +Error: 2 - readfile() expects parameter 2 to be boolean, object given, %s(%d) +File not read + +--undefined var-- +testing readfile + +--unset var-- +testing readfile +===DONE=== diff --git a/ext/standard/tests/file/readfile_variation6.phpt b/ext/standard/tests/file/readfile_variation6.phpt new file mode 100644 index 0000000000..02e708220c --- /dev/null +++ b/ext/standard/tests/file/readfile_variation6.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test readfile() function : variation - test include path +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing readfile() : variation *** +File in include path +===DONE=== diff --git a/ext/standard/tests/file/readfile_variation7.phpt b/ext/standard/tests/file/readfile_variation7.phpt new file mode 100644 index 0000000000..d26f52f492 --- /dev/null +++ b/ext/standard/tests/file/readfile_variation7.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test readfile() function : variation +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing readfile() : variation *** +File in script location +===DONE=== diff --git a/ext/standard/tests/file/readfile_variation8-win32.phpt b/ext/standard/tests/file/readfile_variation8-win32.phpt new file mode 100644 index 0000000000..a66af5d25b --- /dev/null +++ b/ext/standard/tests/file/readfile_variation8-win32.phpt @@ -0,0 +1,109 @@ +--TEST-- +Test readfile() function : variation +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing readfile() : variation *** + +-- %s\readfileVar8\readfileVar8Sub\ -- +The File Contents +-- %s\readfileVar8\readfileVar8Sub\..\readfileVar8Sub -- +The File Contents +-- %s\readfileVar8\readfileVar8Sub\\..\.\readfileVar8Sub -- +The File Contents +-- %s\readfileVar8\readfileVar8Sub\..\..\readfileVar8\.\readfileVar8Sub -- +The File Contents +-- %s\readfileVar8\readfileVar8Sub\..\\\readfileVar8Sub\\..\\..\readfileVar8Sub -- + +Warning: readfile(%s\readfileVar8\readfileVar8Sub\..\\\readfileVar8Sub\\..\\..\readfileVar8Sub\fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d + +-- %s\readfileVar8\readfileVar8Sub\BADDIR -- + +Warning: readfile(%s\readfileVar8\readfileVar8Sub\BADDIR\fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d + +-- readfileVar8\readfileVar8Sub -- +The File Contents +-- readfileVar8\\readfileVar8Sub -- +The File Contents +-- readfileVar8\\\readfileVar8Sub -- +The File Contents +-- .\readfileVar8\..\readfileVar8\readfileVar8Sub -- +The File Contents +-- BADDIR -- + +Warning: readfile(BADDIR\fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d + +-- /%s/readfileVar8/readfileVar8Sub -- +The File Contents +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/readfile_variation9.phpt b/ext/standard/tests/file/readfile_variation9.phpt new file mode 100644 index 0000000000..c802f4018a --- /dev/null +++ b/ext/standard/tests/file/readfile_variation9.phpt @@ -0,0 +1,99 @@ +--TEST-- +Test readfile() function : variation - variable types of path +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +*** Testing readfile() : variation *** + +-- Iteration 1 -- +The File Contents +-- Iteration 2 -- +The File Contents +-- Iteration 3 -- +The File Contents +-- Iteration 4 -- +The File Contents +-- Iteration 5 -- + +Warning: readfile(%sreadfileVar8Sub/..///readfileVar8Sub//..//../readfileVar8Sub/fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d + +-- Iteration 6 -- + +Warning: readfile(%sreadfileVar8Sub/BADDIR/fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d + +-- Iteration 7 -- +The File Contents +-- Iteration 8 -- +The File Contents +-- Iteration 9 -- +The File Contents +-- Iteration 10 -- +The File Contents +-- Iteration 11 -- + +Warning: readfile(BADDIR/fileToRead.tmp): failed to open stream: No such file or directory in %s on line %d + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/readlink_realpath_basic1.phpt b/ext/standard/tests/file/readlink_realpath_basic1.phpt index e2a076c947..99195e2b24 100644 --- a/ext/standard/tests/file/readlink_realpath_basic1.phpt +++ b/ext/standard/tests/file/readlink_realpath_basic1.phpt @@ -39,9 +39,6 @@ $linknames = array ( "$file_path/readlink_realpath_basic1/home/test/readlink_realpath_basic1_link.tmp", "$file_path/readlink_realpath_basic1//home/test//../test/./readlink_realpath_basic1_link.tmp", - // checking for binary safe - b"$file_path/readlink_realpath_basic1/home/readlink_realpath_basic1_link.tmp", - /* linknames with invalid linkpath */ "$file_path///readlink_realpath_basic1/home//..//././test//readlink_realpath_basic1_link.tmp", "$file_path/readlink_realpath_basic1/home/../home/../test/../readlink_realpath_basic1_link.tmp", @@ -89,28 +86,24 @@ string(%d) "%s/readlink_realpath_basic1/home/test/readlink_realpath_basic1.tmp" string(%d) "%s/readlink_realpath_basic1/home/test/readlink_realpath_basic1.tmp" -- Iteration 4 -- -string(%d) "%s/readlink_realpath_basic1/home/readlink_realpath_basic1.tmp" -string(%d) "%s/readlink_realpath_basic1/home/readlink_realpath_basic1.tmp" - --- Iteration 5 -- Warning: readlink(): No such file or directory in %s on line %d bool(false) bool(false) --- Iteration 6 -- +-- Iteration 5 -- Warning: readlink(): No such file or directory in %s on line %d bool(false) bool(false) --- Iteration 7 -- +-- Iteration 6 -- Warning: readlink(): No such file or directory in %s on line %d bool(false) %s --- Iteration 8 -- +-- Iteration 7 -- Warning: readlink(): %s in %s on line %d bool(false) diff --git a/ext/standard/tests/file/readlink_realpath_basic2.phpt b/ext/standard/tests/file/readlink_realpath_basic2.phpt index 7a9e741ef0..91955cd4f5 100644 --- a/ext/standard/tests/file/readlink_realpath_basic2.phpt +++ b/ext/standard/tests/file/readlink_realpath_basic2.phpt @@ -34,9 +34,6 @@ $filenames = array ( "$file_path/readlink_realpath_basic2//home/test//../test/./readlink_realpath_basic2.tmp", "$file_path/readlink_realpath_basic2/home//../././readlink_realpath_basic2.tmp", - // checking for binary safe - b"$file_path/readlink_realpath_basic2/home/readlink_realpath_basic2.tmp", - /* filenames with invalid path */ "$file_path///readlink_realpath_basic2/home//..//././test//readlink_realpath_basic2.tmp", "$file_path/readlink_realpath_basic2/home/../home/../test/../readlink_realpath_basic2.tmp", @@ -79,14 +76,11 @@ string(%d) "%s/readlink_realpath_basic2/home/test/readlink_realpath_basic2.tmp" string(%d) "%s/readlink_realpath_basic2/readlink_realpath_basic2.tmp" -- Iteration 5 -- -string(%d) "%s/readlink_realpath_basic2/home/readlink_realpath_basic2.tmp" +bool(false) -- Iteration 6 -- bool(false) -- Iteration 7 -- -bool(false) - --- Iteration 8 -- %s Done diff --git a/ext/standard/tests/file/readlink_variation1.phpt b/ext/standard/tests/file/readlink_variation1.phpt new file mode 100644 index 0000000000..86bca81fa0 --- /dev/null +++ b/ext/standard/tests/file/readlink_variation1.phpt @@ -0,0 +1,77 @@ +--TEST-- +Test readlink() function: usage variations - invalid filenames +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing Invalid file types *** + +Warning: readlink(): No such file or directory in %s on line %d +bool(false) + +Warning: readlink(): No such file or directory in %s on line %d +bool(false) + +Warning: readlink(): No such file or directory in %s on line %d +bool(false) + +Warning: readlink(): No such file or directory in %s on line %d +bool(false) + +Warning: readlink(): No such file or directory in %s on line %d +bool(false) + +Warning: readlink(): No such file or directory in %s on line %d +bool(false) + +Warning: readlink(): No such file or directory in %s on line %d +bool(false) + +Warning: readlink(): No such file or directory in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/realpath_variation2.phpt b/ext/standard/tests/file/realpath_variation2.phpt new file mode 100644 index 0000000000..a5031aa7b5 --- /dev/null +++ b/ext/standard/tests/file/realpath_variation2.phpt @@ -0,0 +1,74 @@ +--TEST-- +Test realpath() function : variation +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing realpath() : variation *** + +--c:\-- +bool(false) + +--c:-- +bool(false) + +--c-- +bool(false) + +--\-- +bool(false) + +--/-- +string(1) "/" + +--c:temp-- +bool(false) + +--c:\/-- +bool(false) + +--/tmp/-- +string(%d) %s/tmp" + +--/tmp/\-- +bool(false) + +--\tmp-- +bool(false) + +--\tmp\-- +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/rename_variation-win32.phpt b/ext/standard/tests/file/rename_variation-win32.phpt index ae95557603..7d3b1956ae 100644 --- a/ext/standard/tests/file/rename_variation-win32.phpt +++ b/ext/standard/tests/file/rename_variation-win32.phpt @@ -71,7 +71,7 @@ bool(true) Warning: rename(%s/rename_variation/rename_variation.tmp/,%s/rename_variation2.tmp): Invalid argument in %s on line %d bool(false) -bool(true) +bool(false) bool(false) Warning: unlink(%s/rename_variation2.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/rename_variation10.phpt b/ext/standard/tests/file/rename_variation10.phpt new file mode 100644 index 0000000000..fbb109cd28 --- /dev/null +++ b/ext/standard/tests/file/rename_variation10.phpt @@ -0,0 +1,253 @@ +--TEST-- +Test rename() function : usage variation - different types for context +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // file resource + 'file resource' => $fileRes, +); + +// loop through each element of the array for context + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + touch($old_name); + $res = rename($old_name, $new_name, $value); + var_dump($res); + if ($res == true) { + unlink($new_name); + } + else { + unlink($old_name); + } +}; + +fclose($fileRes); + +?> +===DONE=== +--EXPECTF-- +*** Testing rename() : usage variation *** + +--int 0-- +Error: 2 - rename() expects parameter 3 to be resource, integer given, %s(%d) +bool(false) + +--int 1-- +Error: 2 - rename() expects parameter 3 to be resource, integer given, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - rename() expects parameter 3 to be resource, integer given, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - rename() expects parameter 3 to be resource, integer given, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - rename() expects parameter 3 to be resource, double given, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - rename() expects parameter 3 to be resource, double given, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - rename() expects parameter 3 to be resource, double given, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - rename() expects parameter 3 to be resource, double given, %s(%d) +bool(false) + +--float .5-- +Error: 2 - rename() expects parameter 3 to be resource, double given, %s(%d) +bool(false) + +--empty array-- +Error: 2 - rename() expects parameter 3 to be resource, array given, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - rename() expects parameter 3 to be resource, array given, %s(%d) +bool(false) + +--associative array-- +Error: 2 - rename() expects parameter 3 to be resource, array given, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - rename() expects parameter 3 to be resource, array given, %s(%d) +bool(false) + +--uppercase NULL-- +Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - rename() expects parameter 3 to be resource, boolean given, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - rename() expects parameter 3 to be resource, boolean given, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - rename() expects parameter 3 to be resource, boolean given, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - rename() expects parameter 3 to be resource, boolean given, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - rename() expects parameter 3 to be resource, string given, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - rename() expects parameter 3 to be resource, string given, %s(%d) +bool(false) + +--string DQ-- +Error: 2 - rename() expects parameter 3 to be resource, string given, %s(%d) +bool(false) + +--string SQ-- +Error: 2 - rename() expects parameter 3 to be resource, string given, %s(%d) +bool(false) + +--mixed case string-- +Error: 2 - rename() expects parameter 3 to be resource, string given, %s(%d) +bool(false) + +--heredoc-- +Error: 2 - rename() expects parameter 3 to be resource, string given, %s(%d) +bool(false) + +--instance of classWithToString-- +Error: 2 - rename() expects parameter 3 to be resource, object given, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - rename() expects parameter 3 to be resource, object given, %s(%d) +bool(false) + +--undefined var-- +Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) +bool(false) + +--unset var-- +Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) +bool(false) + +--file resource-- +Error: 2 - rename(): supplied resource is not a valid Stream-Context resource, %s(%d) +bool(true) +===DONE=== diff --git a/ext/standard/tests/file/rename_variation11-win32.phpt b/ext/standard/tests/file/rename_variation11-win32.phpt new file mode 100644 index 0000000000..d17b0d283c --- /dev/null +++ b/ext/standard/tests/file/rename_variation11-win32.phpt @@ -0,0 +1,128 @@ +--TEST-- +Test rename() function : variation - various relative, absolute paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--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): No such file or directory 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 +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): No such file or directory in %s on line %d +bool(false) + +-- Iteration 12 -- +bool(true) +bool(true) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/rename_variation12.phpt b/ext/standard/tests/file/rename_variation12.phpt new file mode 100644 index 0000000000..11274f03d2 --- /dev/null +++ b/ext/standard/tests/file/rename_variation12.phpt @@ -0,0 +1,117 @@ +--TEST-- +Test rename() function : variation - various relative, absolute paths +--CREDITS-- +Dave Kelsey +--FILE-- + +--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): No such file or directory 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 +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): No such file or directory in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/rename_variation13-win32.phpt b/ext/standard/tests/file/rename_variation13-win32.phpt new file mode 100644 index 0000000000..1407c01c27 --- /dev/null +++ b/ext/standard/tests/file/rename_variation13-win32.phpt @@ -0,0 +1,139 @@ +--TEST-- +Test rename() function : variation - various invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing rename() with obscure files *** +-- testing '-1' -- +bool(true) + +Warning: rename(-1,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing '1' -- +bool(true) + +Warning: rename(1,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing '' -- + +Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d +bool(false) + +Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing '' -- + +Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d +bool(false) + +Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing '' -- + +Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d +bool(false) + +Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing ' ' -- + +Warning: rename(%s/renameVar13/afile.tmp, ): %s in %s on line %d +bool(false) + +Warning: rename( ,%s/renameVar13/afile.tmp): %s in %s on line %d +bool(false) +-- testing '%s' -- + +Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d +bool(false) + +Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d +bool(false) +-- testing 'Array' -- + +Warning: rename() expects parameter 2 to be string, array given in %s on line %d +bool(false) + +Notice: Array to string conversion in %s on line %d + +Warning: rename() expects parameter 1 to be string, array given in %s on line %d +bool(false) +-- testing '/no/such/file/dir' -- + +Warning: rename(%s/renameVar13/afile.tmp,/no/such/file/dir): No such file or directory in %s on line %d +bool(false) + +Warning: rename(/no/such/file/dir,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing 'php/php' -- + +Warning: rename(%s/renameVar13/afile.tmp,php/php): No such file or directory in %s on line %d +bool(false) + +Warning: rename(php/php,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) + +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/rename_variation13.phpt b/ext/standard/tests/file/rename_variation13.phpt new file mode 100644 index 0000000000..d3082ab383 --- /dev/null +++ b/ext/standard/tests/file/rename_variation13.phpt @@ -0,0 +1,132 @@ +--TEST-- +Test rename() function : variation - various invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing rename() with obscure files *** +-- testing '-1' -- +bool(true) + +Warning: rename(-1,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing '1' -- +bool(true) + +Warning: rename(1,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing '' -- + +Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d +bool(false) + +Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing '' -- + +Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d +bool(false) + +Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing '' -- + +Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d +bool(false) + +Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing ' ' -- +bool(true) + +Warning: rename( ,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing '%s' -- + +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 +bool(false) +-- testing 'Array' -- + +Warning: rename() expects parameter 2 to be string, array given in %s on line %d +bool(false) + +Notice: Array to string conversion in %s on line %d + +Warning: rename() expects parameter 1 to be string, array given in %s on line %d +bool(false) +-- testing '/no/such/file/dir' -- + +Warning: rename(%s/renameVar13/afile.tmp,/no/such/file/dir): No such file or directory in %s on line %d +bool(false) + +Warning: rename(/no/such/file/dir,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +bool(false) +-- testing 'php/php' -- + +Warning: rename(%s/renameVar13/afile.tmp,php/php): %s directory in %s on line %d +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 diff --git a/ext/standard/tests/file/rmdir_variation1-win32.phpt b/ext/standard/tests/file/rmdir_variation1-win32.phpt new file mode 100644 index 0000000000..0732821c54 --- /dev/null +++ b/ext/standard/tests/file/rmdir_variation1-win32.phpt @@ -0,0 +1,127 @@ +--TEST-- +Test rmdir() function : usage variation - invalid filenames +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase false' =>false, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // other + // php outputs Permission Denied, p8 outputs no suck file or dir + 'single space' => ' ', +); + +// loop through each element of the array for dirname + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( rmdir($value) ); +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing rmdir() : usage variation *** + +--uppercase NULL-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--undefined var-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--unset var-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--single space-- +Error: 2 - rmdir( ): %s, %s(%d) +bool(false) +===DONE=== diff --git a/ext/standard/tests/file/rmdir_variation1.phpt b/ext/standard/tests/file/rmdir_variation1.phpt new file mode 100644 index 0000000000..d219e6cdf3 --- /dev/null +++ b/ext/standard/tests/file/rmdir_variation1.phpt @@ -0,0 +1,127 @@ +--TEST-- +Test rmdir() function : usage variation - invalid file names +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase false' =>false, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // other + 'single space' => ' ', +); + +// loop through each element of the array for dirname + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( rmdir($value) ); +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing rmdir() : usage variation *** + +--uppercase NULL-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--undefined var-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--unset var-- +Error: 2 - rmdir(): No such file or directory, %s(%d) +bool(false) + +--single space-- +Error: 2 - rmdir( ): No such file or directory, %s(%d) +bool(false) +===DONE=== diff --git a/ext/standard/tests/file/rmdir_variation2.phpt b/ext/standard/tests/file/rmdir_variation2.phpt new file mode 100644 index 0000000000..2cee440837 --- /dev/null +++ b/ext/standard/tests/file/rmdir_variation2.phpt @@ -0,0 +1,244 @@ +--TEST-- +Test rmdir() function : usage variation - different types for context +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +$fileres = fopen(__FILE__, 'r'); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // non stream context resource + $fileres, +); + +// loop through each element of the array for context + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + @mkdir($dirname); + var_dump( rmdir($dirname, $value) ); +}; + +@rmdir($dirname); +fclose($fileres); +?> +===DONE=== +--EXPECTF-- +*** Testing rmdir() : usage variation *** + +--int 0-- +Error: 2 - rmdir() expects parameter 2 to be resource, integer given, %s(%d) +bool(false) + +--int 1-- +Error: 2 - rmdir() expects parameter 2 to be resource, integer given, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - rmdir() expects parameter 2 to be resource, integer given, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - rmdir() expects parameter 2 to be resource, integer given, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - rmdir() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - rmdir() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - rmdir() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - rmdir() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--float .5-- +Error: 2 - rmdir() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--empty array-- +Error: 2 - rmdir() expects parameter 2 to be resource, array given, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - rmdir() expects parameter 2 to be resource, array given, %s(%d) +bool(false) + +--associative array-- +Error: 2 - rmdir() expects parameter 2 to be resource, array given, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - rmdir() expects parameter 2 to be resource, array given, %s(%d) +bool(false) + +--uppercase NULL-- +Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - rmdir() expects parameter 2 to be resource, boolean given, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - rmdir() expects parameter 2 to be resource, boolean given, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - rmdir() expects parameter 2 to be resource, boolean given, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - rmdir() expects parameter 2 to be resource, boolean given, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - rmdir() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - rmdir() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--string DQ-- +Error: 2 - rmdir() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--string SQ-- +Error: 2 - rmdir() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--mixed case string-- +Error: 2 - rmdir() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--heredoc-- +Error: 2 - rmdir() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--instance of classWithToString-- +Error: 2 - rmdir() expects parameter 2 to be resource, object given, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - rmdir() expects parameter 2 to be resource, object given, %s(%d) +bool(false) + +--undefined var-- +Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) +bool(false) + +--unset var-- +Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) +bool(false) + +--0-- +Error: 2 - rmdir(): supplied resource is not a valid Stream-Context resource, %s(%d) +bool(true) +===DONE=== diff --git a/ext/standard/tests/file/rmdir_variation3-win32.phpt b/ext/standard/tests/file/rmdir_variation3-win32.phpt new file mode 100644 index 0000000000..e6b3eaabb6 --- /dev/null +++ b/ext/standard/tests/file/rmdir_variation3-win32.phpt @@ -0,0 +1,108 @@ +--TEST-- +Test rmdir() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing rmdir() : variation *** +-- removing rmdirVar3.tmp\aSubDir -- +Directory removed +-- removing .\rmdirVar3.tmp\aSubDir -- +Directory removed +-- removing rmdirVar3.tmp\..\rmdirVar3.tmp\aSubDir -- +Directory removed +-- removing rmdirVar3.tmp\..\BADDIR\aSubDir -- + +Warning: rmdir(rmdirVar3.tmp\..\BADDIR\aSubDir): No such file or directory in %s on line %d +-- removing BADDIR\aSubDir -- + +Warning: rmdir(BADDIR\aSubDir): No such file or directory in %s on line %d +-- removing %s\rmdirVar3.tmp\aSubDir -- +Directory removed +-- removing %s\.\rmdirVar3.tmp\aSubDir -- +Directory removed +-- removing %s\rmdirVar3.tmp\..\rmdirVar3.tmp\aSubDir -- +Directory removed +-- removing %s\BADDIR\aSubDir -- + +Warning: rmdir(%s\BADDIR\aSubDir): No such file or directory in %s on line %d +-- removing rmdirVar3.tmp\aSubDir\ -- +Directory removed +-- removing %s\rmdirVar3.tmp\aSubDir\ -- +Directory removed +-- removing rmdirVar3.tmp\\aSubDir -- +Directory removed +-- removing %s\\rmdirVar3.tmp\\aSubDir -- +Directory removed +-- removing /%s/rmdirVar3.tmp/aSubDir -- +Directory removed +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/rmdir_variation3.phpt b/ext/standard/tests/file/rmdir_variation3.phpt new file mode 100644 index 0000000000..5848007395 --- /dev/null +++ b/ext/standard/tests/file/rmdir_variation3.phpt @@ -0,0 +1,96 @@ +--TEST-- +Test rmdir() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing rmdir() : variation *** +-- removing rmdirVar3.tmp/aSubDir -- +Directory removed +-- removing ./rmdirVar3.tmp/aSubDir -- +Directory removed +-- removing rmdirVar3.tmp/../rmdirVar3.tmp/aSubDir -- +Directory removed +-- removing rmdirVar3.tmp/../BADDIR/aSubDir -- + +Warning: rmdir(rmdirVar3.tmp/../BADDIR/aSubDir): No such file or directory in %s on line %d +-- removing BADDIR/aSubDir -- + +Warning: rmdir(BADDIR/aSubDir): No such file or directory in %s on line %d +-- removing %s/rmdirVar3.tmp/aSubDir -- +Directory removed +-- removing %s/./rmdirVar3.tmp/aSubDir -- +Directory removed +-- removing %s/rmdirVar3.tmp/../rmdirVar3.tmp/aSubDir -- +Directory removed +-- removing %s/BADDIR/aSubDir -- + +Warning: rmdir(%s/BADDIR/aSubDir): No such file or directory in %s on line %d +-- removing rmdirVar3.tmp/aSubDir/ -- +Directory removed +-- removing %s/rmdirVar3.tmp/aSubDir/ -- +Directory removed +-- removing rmdirVar3.tmp//aSubDir -- +Directory removed +-- removing %s//rmdirVar3.tmp//aSubDir -- +Directory removed +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt index b2ba0c889f..52dd4b5345 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt @@ -42,6 +42,7 @@ var_dump( link($filename, $linkname, false) ); //invalid arguments var_dump( link(NULL, $linkname) ); // NULL as filename var_dump( link('', $linkname) ); // empty string as filename +var_dump( link(' ', $linkname) ); // space as filename var_dump( link(false, $linkname) ); // boolean false as filename var_dump( link($filename, NULL) ); // NULL as linkname var_dump( link($filename, '') ); // '' as linkname @@ -57,6 +58,7 @@ var_dump( is_link($linkname, "/") ); //invalid arguments var_dump( is_link(NULL) ); // NULL as linkname var_dump( is_link('') ); // empty string as linkname +var_dump( is_link(' ') ); // space as linkname var_dump( is_link(false) ); // boolean false as linkname var_dump( is_link($filename) ); // file given to is_link @@ -93,6 +95,9 @@ bool(false) Warning: link(): %s in %s on line %d bool(false) +Warning: link(): %s in %s on line %d +bool(false) + *** Testing is_link() for error conditions *** Warning: Wrong parameter count for is_link() in %s on line %d @@ -104,4 +109,5 @@ bool(false) bool(false) bool(false) bool(false) +bool(false) Done diff --git a/ext/standard/tests/file/tempnam_variation1-win32.phpt b/ext/standard/tests/file/tempnam_variation1-win32.phpt index 9075950330..a3dd7e9d62 100644 --- a/ext/standard/tests/file/tempnam_variation1-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation1-win32.phpt @@ -3,7 +3,7 @@ Test tempnam() function: usage variations - creating files --SKIPIF-- --FILE-- "; + $file_dir = dirname($files[$i]); + + 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"; + } + clearstatcache(); } else { print("- File is not created -"); @@ -39,39 +53,51 @@ for($i=1; $i<=10; $i++) { for($i=1; $i<=10; $i++) { unlink($files[$i]); } +rmdir($file_path); + echo "*** Done ***\n"; ?> --EXPECTF-- *** Testing tempnam() in creation of unique files *** -- Iteration 1 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified -- Iteration 2 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified -- Iteration 3 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified -- Iteration 4 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified -- Iteration 5 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified -- Iteration 6 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified -- Iteration 7 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified -- Iteration 8 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified -- Iteration 9 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified -- Iteration 10 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => directory specified *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation1.phpt b/ext/standard/tests/file/tempnam_variation1.phpt index c94a65ba21..0745f5397c 100644 --- a/ext/standard/tests/file/tempnam_variation1.phpt +++ b/ext/standard/tests/file/tempnam_variation1.phpt @@ -13,7 +13,8 @@ if(substr(PHP_OS, 0, 3) == "WIN") /* Creating number of unique files by passing a file name as prefix */ -$file_path = dirname(__FILE__); +$file_path = dirname(__FILE__)."/tempnamVar1"; +mkdir($file_path); echo "*** Testing tempnam() in creation of unique files ***\n"; for($i=1; $i<=10; $i++) { @@ -34,6 +35,19 @@ for($i=1; $i<=10; $i++) { echo "File inode is => "; print_r( fileinode($files[$i]) ); //checking inodes echo "\n"; + + echo "File created in => "; + $file_dir = dirname($files[$i]); + + if ($file_dir == sys_get_temp_dir()) { + echo "temp dir\n"; + } + else if ($file_dir == $file_path) { + echo "directory specified\n"; + } + else { + echo "unknown location\n"; + } clearstatcache(); } else { @@ -44,48 +58,59 @@ for($i=1; $i<=10; $i++) { unlink($files[$i]); } +rmdir($file_path); echo "*** Done ***\n"; ?> --EXPECTF-- *** Testing tempnam() in creation of unique files *** -- Iteration 1 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified -- Iteration 2 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified -- Iteration 3 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified -- Iteration 4 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified -- Iteration 5 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified -- Iteration 6 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified -- Iteration 7 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified -- Iteration 8 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified -- Iteration 9 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified -- Iteration 10 -- -File name is => %s +File name is => %s%etempnam_variation1.tmp%s File permissions are => 100600 File inode is => %d +File created in => directory specified *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation2-win32.phpt b/ext/standard/tests/file/tempnam_variation2-win32.phpt index a9fe4fd2d6..4224966daf 100644 --- a/ext/standard/tests/file/tempnam_variation2-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation2-win32.phpt @@ -1,9 +1,9 @@ --TEST-- -Test tempnam() function: usage variations - relative paths +Test tempnam() function: usage variations - various absolute and relative paths --SKIPIF-- --FILE-- "; printf("%o", fileperms($file_name) ); echo "\n"; + + echo "File created in => "; + $file_dir = dirname($file_name); + $dir_req = $dir_paths[$i]; + + 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($dir_req) || realpath($file_dir."\\") == realpath($dir_req)) { + echo "directory specified\n"; + } + else { + echo "unknown location\n"; + } + + } - else + else { echo "-- File is not created --"; - unlink($file_name); + } + + unlink($file_name); } chdir($old_dir_path); @@ -60,38 +88,76 @@ rmdir($dir_name); echo "\n*** Done ***\n"; ?> --EXPECTF-- -*** Testing tempnam() with relative paths *** +*** Testing tempnam() with absolute and relative paths *** -- Iteration 1 -- -File name is => %s +File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s File permissions are => 100666 +File created in => directory specified -- Iteration 2 -- -File name is => %s +File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s File permissions are => 100666 +File created in => directory specified -- Iteration 3 -- -File name is => %s +File name is => %s\tempnam_variation2\t%s File permissions are => 100666 +File created in => directory specified -- Iteration 4 -- -File name is => %s +File name is => %s\tempnam_variation2\t%s File permissions are => 100666 +File created in => directory specified -- Iteration 5 -- -File name is => %s +File name is => %s\tempnam_variation2\t%s File permissions are => 100666 +File created in => directory specified -- Iteration 6 -- -File name is => %s +File name is => %s\tempnam_variation2\t%s File permissions are => 100666 +File created in => directory specified -- Iteration 7 -- -File name is => %s +File name is => %s\t%s File permissions are => 100666 +File created in => temp dir -- Iteration 8 -- -File name is => %s +File name is => %s\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 9 -- +File name is => %s\t%s +File permissions are => 100666 +File created in => temp dir + +-- Iteration 10 -- +File name is => %s\t%s +File permissions are => 100666 +File created in => temp dir + +-- Iteration 11 -- +File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 12 -- +File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 13 -- +File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 14 -- +File name is => %s\t%s File permissions are => 100666 +File created in => temp dir -*** Done *** +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/tempnam_variation2.phpt b/ext/standard/tests/file/tempnam_variation2.phpt index 6d85e25628..b7e5cdc058 100644 --- a/ext/standard/tests/file/tempnam_variation2.phpt +++ b/ext/standard/tests/file/tempnam_variation2.phpt @@ -1,5 +1,5 @@ --TEST-- -Test tempnam() function: usage variations - relative paths +Test tempnam() function: usage variations - various absolute and relative paths --SKIPIF-- "; printf("%o", fileperms($file_name) ); echo "\n"; + + echo "File created in => "; + $file_dir = dirname($file_name); + $dir_req = $dir_paths[$i]; + + if (realpath($file_dir) == realpath(sys_get_temp_dir())) { + echo "temp dir\n"; + } + else if ($file_dir == realpath($dir_req)) { + echo "directory specified\n"; + } + else { + echo "unknown location\n"; + } + + } - else + else { echo "-- File is not created --"; - unlink($file_name); + } + + unlink($file_name); } chdir($old_dir_path); @@ -60,38 +88,76 @@ rmdir($dir_name); echo "\n*** Done ***\n"; ?> --EXPECTF-- -*** Testing tempnam() with relative paths *** +*** Testing tempnam() with absolute and relative paths *** -- Iteration 1 -- -File name is => %s +File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s File permissions are => 100600 +File created in => directory specified -- Iteration 2 -- -File name is => %s +File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s File permissions are => 100600 +File created in => directory specified -- Iteration 3 -- -File name is => %s +File name is => %s/tempnam_variation2/tempnam_variation2.tmp%s File permissions are => 100600 +File created in => directory specified -- Iteration 4 -- -File name is => %s +File name is => %s/tempnam_variation2/tempnam_variation2.tmp%s File permissions are => 100600 +File created in => directory specified -- Iteration 5 -- -File name is => %s +File name is => %s/tempnam_variation2/tempnam_variation2.tmp%s File permissions are => 100600 +File created in => directory specified -- Iteration 6 -- -File name is => %s +File name is => %s/tempnam_variation2/tempnam_variation2.tmp%s File permissions are => 100600 +File created in => directory specified -- Iteration 7 -- -File name is => %s +File name is => %s/tempnam_variation2.tmp%s File permissions are => 100600 +File created in => temp dir -- Iteration 8 -- -File name is => %s +File name is => %s/tempnam_variation2.tmp%s +File permissions are => 100600 +File created in => directory specified + +-- Iteration 9 -- +File name is => %s/tempnam_variation2.tmp%s +File permissions are => 100600 +File created in => temp dir + +-- Iteration 10 -- +File name is => %s/tempnam_variation2.tmp%s +File permissions are => 100600 +File created in => temp dir + +-- Iteration 11 -- +File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s +File permissions are => 100600 +File created in => directory specified + +-- Iteration 12 -- +File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s +File permissions are => 100600 +File created in => directory specified + +-- Iteration 13 -- +File name is => %s/tempnam_variation2/tempnam_variation2_sub/tempnam_variation2.tmp%s +File permissions are => 100600 +File created in => directory specified + +-- Iteration 14 -- +File name is => %s/tempnam_variation2.tmp%s File permissions are => 100600 +File created in => temp dir -*** Done *** +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index 9dab922712..da0133af9d 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -1,9 +1,9 @@ --TEST-- -Test tempnam() function: usage variations - invalid/non-existing file +Test tempnam() function: usage variations - obscure prefixes --SKIPIF-- --FILE-- "; 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 + else { echo "-- File is not created --\n"; + } unlink($file_name); } +rmdir($file_path); echo "\n*** Done ***\n"; ?> --EXPECTF-- -*** Testing tempnam() with invalid/non-existing file names *** +*** Testing tempnam() with obscure prefixes *** +-- Iteration 0 -- +File name is => %s\%s +File permissions are => 100666 +File created in => directory specified -- Iteration 1 -- -File name is => %s +File name is => %s\%s File permissions are => 100666 +File created in => directory specified -- Iteration 2 -- -File name is => %s +File name is => %s\%s File permissions are => 100666 +File created in => directory specified -- Iteration 3 -- -File name is => %s +File name is => %s\%s File permissions are => 100666 +File created in => directory specified -- Iteration 4 -- -File name is => %s +File name is => %s\%s File permissions are => 100666 +File created in => directory specified -- Iteration 5 -- -File name is => %s +File name is => %s\%s File permissions are => 100666 +File created in => directory specified -- Iteration 6 -- -File name is => %s +File name is => %s\%s File permissions are => 100666 +File created in => directory specified -- Iteration 7 -- Notice: Array to string conversion in %s on line %d -File name is => %s +File name is => %s\Ar%s File permissions are => 100666 +File created in => directory specified -- Iteration 8 -- -File name is => %s +File name is => %s\di%s File permissions are => 100666 +File created in => directory specified -- Iteration 9 -- -File name is => %s +File name is => %s\ph%s File permissions are => 100666 +File created in => directory specified *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index 08748bdc5a..e350849fd9 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -1,5 +1,5 @@ --TEST-- -Test tempnam() function: usage variations - invalid/non-existing file +Test tempnam() function: usage variations - obscure prefixes --SKIPIF-- "; printf("%o", fileperms($file_name) ); echo "\n"; + + echo "File created in => "; + $file_dir = dirname($file_name); + + if ($file_dir == sys_get_temp_dir()) { + echo "temp dir\n"; + } + else if ($file_dir == $file_path) { + echo "directory specified\n"; + } + else { + echo "unknown location\n"; + } + } - else + else { echo "-- File is not created --\n"; + } unlink($file_name); } +rmdir($file_path); echo "\n*** Done ***\n"; ?> --EXPECTF-- -*** Testing tempnam() with invalid/non-existing file names *** +*** Testing tempnam() with obscure prefixes *** +-- Iteration 0 -- +File name is => %s/%s +File permissions are => 100600 +File created in => directory specified -- Iteration 1 -- -File name is => %s +File name is => %s/%s File permissions are => 100600 +File created in => directory specified -- Iteration 2 -- -File name is => %s +File name is => %s/%s File permissions are => 100600 +File created in => directory specified -- Iteration 3 -- -File name is => %s +File name is => %s/%s File permissions are => 100600 +File created in => directory specified -- Iteration 4 -- -File name is => %s +File name is => %s/%s File permissions are => 100600 +File created in => directory specified -- Iteration 5 -- -File name is => %s +File name is => %s/%s File permissions are => 100600 +File created in => directory specified -- Iteration 6 -- -File name is => %s +File name is => %s/%s File permissions are => 100600 +File created in => directory specified -- Iteration 7 -- Notice: Array to string conversion in %s on line %d -File name is => %s +File name is => %s/Array%s File permissions are => 100600 +File created in => directory specified -- Iteration 8 -- -File name is => %s +File name is => %s/dir%s File permissions are => 100600 +File created in => directory specified -- Iteration 9 -- -File name is => %s +File name is => %s/php%s File permissions are => 100600 +File created in => directory specified *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation4.phpt b/ext/standard/tests/file/tempnam_variation4.phpt index 491eae7343..8fec4019fc 100644 --- a/ext/standard/tests/file/tempnam_variation4.phpt +++ b/ext/standard/tests/file/tempnam_variation4.phpt @@ -20,22 +20,34 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { echo "*** Testing tempnam() with dir of permissions from 0000 to 0777 ***\n"; $file_path = dirname(__FILE__); $dir_name = $file_path."/tempnam_variation4"; +$prefix = "tempnamVar4."; + mkdir($dir_name); -for($mode = 0000; $mode<=0777; $mode++) { +for($mode = 0000; $mode <= 0777; $mode++) { echo "-- dir perms "; printf("%o", $mode); echo " --\n"; chmod($dir_name, $mode); - $file_name = tempnam($dir_name, "tempnam_variation4.tmp"); + $file_name = tempnam($dir_name, $prefix); if(file_exists($file_name) ) { - print($file_name); - echo "\n"; + if (realpath(dirname($file_name)) == realpath(sys_get_temp_dir())) { + $msg = " created in temp directory"; + } + else if (dirname($file_name) == $dir_name) { + $msg = " created in requested directory"; + } + else { + $msg = " created in unexpected directory"; + } + + echo basename($file_name).$msg."\n"; + unlink($file_name); + } + else { + print("FAILED: File is not created\n"); } - else - print("-- File is not created --"); - unlink($file_name); } rmdir($dir_name); @@ -45,1027 +57,1027 @@ echo "*** Done ***\n"; --EXPECTF-- *** Testing tempnam() with dir of permissions from 0000 to 0777 *** -- dir perms 0 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 1 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 2 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 3 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 4 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 5 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 6 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 7 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 10 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 11 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 12 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 13 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 14 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 15 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 16 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 17 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 20 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 21 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 22 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 23 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 24 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 25 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 26 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 27 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 30 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 31 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 32 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 33 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 34 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 35 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 36 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 37 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 40 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 41 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 42 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 43 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 44 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 45 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 46 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 47 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 50 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 51 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 52 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 53 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 54 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 55 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 56 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 57 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 60 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 61 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 62 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 63 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 64 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 65 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 66 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 67 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 70 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 71 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 72 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 73 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 74 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 75 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 76 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 77 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 100 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 101 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 102 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 103 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 104 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 105 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 106 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 107 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 110 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 111 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 112 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 113 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 114 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 115 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 116 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 117 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 120 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 121 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 122 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 123 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 124 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 125 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 126 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 127 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 130 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 131 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 132 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 133 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 134 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 135 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 136 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 137 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 140 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 141 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 142 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 143 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 144 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 145 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 146 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 147 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 150 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 151 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 152 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 153 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 154 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 155 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 156 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 157 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 160 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 161 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 162 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 163 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 164 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 165 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 166 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 167 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 170 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 171 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 172 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 173 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 174 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 175 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 176 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 177 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 200 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 201 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 202 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 203 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 204 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 205 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 206 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 207 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 210 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 211 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 212 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 213 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 214 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 215 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 216 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 217 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 220 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 221 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 222 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 223 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 224 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 225 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 226 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 227 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 230 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 231 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 232 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 233 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 234 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 235 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 236 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 237 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 240 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 241 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 242 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 243 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 244 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 245 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 246 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 247 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 250 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 251 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 252 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 253 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 254 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 255 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 256 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 257 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 260 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 261 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 262 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 263 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 264 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 265 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 266 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 267 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 270 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 271 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 272 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 273 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 274 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 275 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 276 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 277 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 300 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 301 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 302 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 303 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 304 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 305 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 306 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 307 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 310 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 311 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 312 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 313 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 314 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 315 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 316 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 317 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 320 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 321 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 322 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 323 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 324 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 325 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 326 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 327 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 330 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 331 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 332 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 333 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 334 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 335 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 336 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 337 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 340 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 341 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 342 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 343 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 344 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 345 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 346 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 347 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 350 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 351 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 352 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 353 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 354 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 355 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 356 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 357 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 360 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 361 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 362 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 363 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 364 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 365 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 366 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 367 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 370 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 371 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 372 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 373 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 374 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 375 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 376 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 377 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 400 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 401 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 402 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 403 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 404 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 405 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 406 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 407 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 410 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 411 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 412 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 413 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 414 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 415 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 416 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 417 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 420 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 421 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 422 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 423 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 424 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 425 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 426 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 427 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 430 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 431 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 432 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 433 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 434 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 435 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 436 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 437 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 440 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 441 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 442 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 443 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 444 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 445 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 446 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 447 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 450 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 451 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 452 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 453 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 454 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 455 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 456 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 457 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 460 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 461 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 462 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 463 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 464 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 465 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 466 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 467 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 470 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 471 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 472 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 473 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 474 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 475 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 476 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 477 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 500 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 501 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 502 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 503 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 504 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 505 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 506 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 507 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 510 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 511 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 512 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 513 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 514 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 515 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 516 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 517 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 520 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 521 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 522 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 523 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 524 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 525 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 526 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 527 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 530 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 531 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 532 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 533 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 534 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 535 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 536 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 537 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 540 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 541 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 542 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 543 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 544 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 545 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 546 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 547 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 550 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 551 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 552 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 553 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 554 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 555 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 556 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 557 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 560 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 561 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 562 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 563 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 564 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 565 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 566 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 567 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 570 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 571 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 572 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 573 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 574 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 575 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 576 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 577 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 600 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 601 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 602 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 603 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 604 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 605 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 606 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 607 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 610 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 611 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 612 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 613 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 614 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 615 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 616 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 617 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 620 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 621 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 622 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 623 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 624 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 625 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 626 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 627 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 630 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 631 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 632 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 633 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 634 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 635 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 636 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 637 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 640 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 641 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 642 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 643 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 644 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 645 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 646 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 647 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 650 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 651 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 652 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 653 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 654 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 655 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 656 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 657 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 660 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 661 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 662 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 663 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 664 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 665 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 666 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 667 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 670 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 671 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 672 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 673 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 674 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 675 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 676 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 677 -- -%s +tempnamVar4.%s created in temp directory -- dir perms 700 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 701 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 702 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 703 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 704 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 705 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 706 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 707 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 710 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 711 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 712 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 713 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 714 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 715 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 716 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 717 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 720 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 721 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 722 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 723 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 724 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 725 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 726 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 727 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 730 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 731 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 732 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 733 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 734 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 735 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 736 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 737 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 740 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 741 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 742 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 743 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 744 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 745 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 746 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 747 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 750 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 751 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 752 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 753 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 754 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 755 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 756 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 757 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 760 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 761 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 762 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 763 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 764 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 765 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 766 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 767 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 770 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 771 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 772 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 773 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 774 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 775 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 776 -- -%s +tempnamVar4.%s created in requested directory -- dir perms 777 -- -%s -*** Done *** +tempnamVar4.%s created in requested directory +*** Done *** \ No newline at end of file diff --git a/ext/standard/tests/file/tempnam_variation5-win32.phpt b/ext/standard/tests/file/tempnam_variation5-win32.phpt new file mode 100644 index 0000000000..3e39352fe1 --- /dev/null +++ b/ext/standard/tests/file/tempnam_variation5-win32.phpt @@ -0,0 +1,54 @@ +--TEST-- +Test tempnam() function: usage variations - existing file +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + "; + print($created_file); + echo "\n"; + } + else + print("File is not created"); + + unlink($created_file); +} +fclose($h); +unlink($dir_name."/tempnam_variation6.tmp"); +rmdir($dir_name); + +echo "\n*** Done ***\n"; +?> +--EXPECTF-- +*** Test tempnam() function: by passing an existing filename as prefix *** +-- Iteration 1 -- +File name is => %stempnam_variation6%et%s +-- Iteration 2 -- +File name is => %stempnam_variation6%et%s +-- Iteration 3 -- +File name is => %stempnam_variation6%et%s + +*** Done *** diff --git a/ext/standard/tests/file/tempnam_variation5.phpt b/ext/standard/tests/file/tempnam_variation5.phpt index 2d5f53dcd3..26c3f91f1f 100644 --- a/ext/standard/tests/file/tempnam_variation5.phpt +++ b/ext/standard/tests/file/tempnam_variation5.phpt @@ -1,5 +1,10 @@ --TEST-- Test tempnam() function: usage variations - existing file +--SKIPIF-- + --FILE-- %s +File name is => %stempnam_variation6%etempnam_variation6.tmp%s -- Iteration 2 -- -File name is => %s +File name is => %stempnam_variation6%etempnam_variation6.tmp%s -- Iteration 3 -- -File name is => %s +File name is => %stempnam_variation6%etempnam_variation6.tmp%s *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation6-win32.phpt b/ext/standard/tests/file/tempnam_variation6-win32.phpt new file mode 100644 index 0000000000..efe7e86e85 --- /dev/null +++ b/ext/standard/tests/file/tempnam_variation6-win32.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test tempnam() function: usage variations - Using previous unique filename +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + "; + print($file_name); + echo "\n"; + + echo "File created in => "; + $file_dir = dirname($file_name); + + if ($file_dir == sys_get_temp_dir()) { + echo "temp dir\n"; + } + else if ($file_dir == $file_path) { + echo "directory specified\n"; + } + else { + echo "unknown location\n"; + } + } + + unlink($file_name); +} + +echo "\n*** Done ***\n"; +?> +--EXPECTF-- +*** Test tempnam(): by passing previously created filenames *** +-- Iteration 1 -- +File name is => %s%et%s +File created in => directory specified +-- Iteration 2 -- +File name is => %s%et%s +File created in => directory specified +-- Iteration 3 -- +File name is => %s%et%s +File created in => directory specified + +*** Done *** diff --git a/ext/standard/tests/file/tempnam_variation6.phpt b/ext/standard/tests/file/tempnam_variation6.phpt index 51ecde9a73..5eb6e6fc86 100644 --- a/ext/standard/tests/file/tempnam_variation6.phpt +++ b/ext/standard/tests/file/tempnam_variation6.phpt @@ -1,5 +1,10 @@ --TEST-- -Test tempnam() function: usage variations - Using previous unique filename +Test tempnam() function: usage variations - Using previous unique filename +--SKIPIF-- + --FILE-- "; print($file_name); echo "\n"; - } + + echo "File created in => "; + $file_dir = dirname($file_name); + + if ($file_dir == sys_get_temp_dir()) { + echo "temp dir\n"; + } + else if ($file_dir == $file_path) { + echo "directory specified\n"; + } + else { + echo "unknown location\n"; + } + } unlink($file_name); } @@ -30,10 +48,13 @@ echo "\n*** Done ***\n"; --EXPECTF-- *** Test tempnam(): by passing previously created filenames *** -- Iteration 1 -- -File name is => %s +File name is => %s%etempnam_variation6.tmp%s +File created in => directory specified -- Iteration 2 -- -File name is => %s +File name is => %s%etempnam_variation6.tmp%s +File created in => directory specified -- Iteration 3 -- -File name is => %s +File name is => %s%etempnam_variation6.tmp%s +File created in => directory specified *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt index a88866b9b3..98fd2ba378 100644 --- a/ext/standard/tests/file/tempnam_variation7-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt @@ -3,7 +3,7 @@ Test tempnam() function: usage variations - invalid/non-existing dir --SKIPIF-- --FILE-- "; 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 + else { echo "-- File is not created --\n"; + } unlink($file_name); } @@ -59,34 +67,47 @@ echo "\n*** Done ***\n"; ?> --EXPECTF-- *** Testing tempnam() with invalid/non-existing directory names *** +-- Iteration 0 -- +File name is => %s%et%s +File permissions are => 100666 +File created in => temp dir -- Iteration 1 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => temp dir -- Iteration 2 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => temp dir -- Iteration 3 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => temp dir -- Iteration 4 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => temp dir -- Iteration 5 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => temp dir -- Iteration 6 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => temp dir -- Iteration 7 -- Notice: Array to string conversion in %s on line %d -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => temp dir -- Iteration 8 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => temp dir -- Iteration 9 -- -File name is => %s +File name is => %s%et%s File permissions are => 100666 +File created in => temp dir *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt index b4b0035c9c..65001207e9 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -15,8 +15,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") hence the unique files will be created in temporary dir */ echo "*** Testing tempnam() with invalid/non-existing directory names ***\n"; -$file_path = dirname(__FILE__); - /* An array of names, which will be passed as a dir name */ $names_arr = array( /* Invalid args */ @@ -26,7 +24,7 @@ $names_arr = array( NULL, "", " ", - "/0", + "\0", array(), /* Non-existing dirs */ @@ -35,7 +33,7 @@ $names_arr = array( ); -for( $i=1; $i "; 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())) { + echo "temp dir\n"; + } + else { + echo "unknown location\n"; + } + } - else + else { echo "-- File is not created --\n"; + } unlink($file_name); } @@ -59,34 +69,47 @@ echo "\n*** Done ***\n"; ?> --EXPECTF-- *** Testing tempnam() with invalid/non-existing directory names *** +-- Iteration 0 -- +File name is => %s%etempnam_variation3.tmp%s +File permissions are => 100600 +File created in => temp dir -- Iteration 1 -- -File name is => %s +File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 +File created in => temp dir -- Iteration 2 -- -File name is => %s +File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 +File created in => temp dir -- Iteration 3 -- -File name is => %s +File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 +File created in => temp dir -- Iteration 4 -- -File name is => %s +File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 +File created in => temp dir -- Iteration 5 -- -File name is => %s +File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 +File created in => temp dir -- Iteration 6 -- -File name is => %s +File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 +File created in => temp dir -- Iteration 7 -- Notice: Array to string conversion in %s on line %d -File name is => %s +File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 +File created in => temp dir -- Iteration 8 -- -File name is => %s +File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 +File created in => temp dir -- Iteration 9 -- -File name is => %s +File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 +File created in => temp dir *** Done *** diff --git a/ext/standard/tests/file/tempnam_variation8-win32.phpt b/ext/standard/tests/file/tempnam_variation8-win32.phpt new file mode 100644 index 0000000000..8df67b609e --- /dev/null +++ b/ext/standard/tests/file/tempnam_variation8-win32.phpt @@ -0,0 +1,147 @@ +--TEST-- +Test tempnam() function: usage variations - various absolute and relative paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + "; + print(realpath($file_name)); + echo "\n"; + + echo "File permissions are => "; + printf("%o", fileperms($file_name) ); + echo "\n"; + + echo "File created in => "; + $file_dir = dirname($file_name); + $dir_req = $dir_paths[$i]; + + 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($dir_req) || realpath($file_dir."\\") == realpath($dir_req)) { + echo "directory specified\n"; + } + else { + echo "unknown location\n"; + } + + + } + else { + echo "-- File is not created --"; + } + + unlink($file_name); +} + +chdir($old_dir_path); +rmdir($dir_path); +rmdir($dir_name); + +echo "\n*** Done ***\n"; +?> +--EXPECTF-- +*** Testing tempnam() with absolute and relative paths *** + +-- Iteration 1 -- +File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 2 -- +File name is => %s\tempnam_variation2\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 3 -- +File name is => %s\tempnam_variation2\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 4 -- +File name is => %s\tempnam_variation2\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 5 -- +File name is => %s\tempnam_variation2\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 6 -- +File name is => %s\t%s +File permissions are => 100666 +File created in => temp dir + +-- Iteration 7 -- +File name is => %s\t%s +File permissions are => 100666 +File created in => temp dir + +-- Iteration 8 -- +File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 9 -- +File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 10 -- +File name is => %s\tempnam_variation2\tempnam_variation2_sub\t%s +File permissions are => 100666 +File created in => directory specified + +-- Iteration 11 -- +File name is => %s\t%s +File permissions are => 100666 +File created in => temp dir + +*** Done *** diff --git a/ext/standard/tests/file/touch.phpt b/ext/standard/tests/file/touch.phpt index 504674f17d..4ea1ffd404 100644 --- a/ext/standard/tests/file/touch.phpt +++ b/ext/standard/tests/file/touch.phpt @@ -1,8 +1,16 @@ --TEST-- touch() tests +--SKIPIF-- + --FILE-- +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing touch() : basic functionality *** + +--- testing touch creates a file --- +bool(true) + + --- testing touch doesn't alter file contents --- +Here is a test line + + --- testing touch alters the correct file metadata --- +stat data differs at atime +stat data differs at mtime + + --- testing touch using all parameters --- +bool(true) +ctime=%d +mtime=10000 +atime=20470 +Done diff --git a/ext/standard/tests/file/touch_basic.phpt b/ext/standard/tests/file/touch_basic.phpt new file mode 100644 index 0000000000..fb042df674 --- /dev/null +++ b/ext/standard/tests/file/touch_basic.phpt @@ -0,0 +1,96 @@ +--TEST-- +Test touch() function : basic functionality +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Testing touch() : basic functionality *** + +--- testing touch creates a file --- +bool(true) + + --- testing touch doesn't alter file contents --- +Here is a test line + + --- testing touch alters the correct file metadata --- +stat data differs at atime +stat data differs at mtime +stat data differs at ctime + + --- testing touch using all parameters --- +bool(true) +ctime=%d +mtime=10000 +atime=20470 +Done diff --git a/ext/standard/tests/file/touch_error.phpt b/ext/standard/tests/file/touch_error.phpt new file mode 100644 index 0000000000..778969928a --- /dev/null +++ b/ext/standard/tests/file/touch_error.phpt @@ -0,0 +1,21 @@ +--TEST-- +touch() error tests +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECTF-- +Warning: Wrong parameter count for touch() in %s on line %d +NULL + +Warning: Wrong parameter count for touch() in %s on line %d +NULL + +Warning: touch(): Unable to create file /no/such/file/or/directory because %s in %s on line %d +bool(false) \ No newline at end of file diff --git a/ext/standard/tests/file/touch_variation1.phpt b/ext/standard/tests/file/touch_variation1.phpt new file mode 100644 index 0000000000..dba41a6077 --- /dev/null +++ b/ext/standard/tests/file/touch_variation1.phpt @@ -0,0 +1,39 @@ +--TEST-- +touch() with times +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(true) +int(101) +int(101) +bool(true) +int(100) +int(102) +Done \ No newline at end of file diff --git a/ext/standard/tests/file/touch_variation2.phpt b/ext/standard/tests/file/touch_variation2.phpt new file mode 100644 index 0000000000..9ccb90c751 --- /dev/null +++ b/ext/standard/tests/file/touch_variation2.phpt @@ -0,0 +1,24 @@ +--TEST-- +touch() - ensure touch does not delete existing file. +--CREDITS-- +Dave Kelsey +--FILE-- + +--EXPECT-- +bool(true) +string(6) "mydata" +Done diff --git a/ext/standard/tests/file/touch_variation3-win32.phpt b/ext/standard/tests/file/touch_variation3-win32.phpt new file mode 100644 index 0000000000..c994199c70 --- /dev/null +++ b/ext/standard/tests/file/touch_variation3-win32.phpt @@ -0,0 +1,198 @@ +--TEST-- +Test touch() function : usage variation - different types for time +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for time + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( touch($filename, $value, $atime) ); +}; + +unlink($filename); + +?> +===DONE=== +--EXPECTF-- +*** Testing touch() : usage variation *** + +--float 10.5-- +bool(true) + +--float -10.5-- +Error: 2 - touch(): Utime failed: Invalid argument, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - touch(): Utime failed: Invalid argument, %s(%d) +bool(false) + +--float -12.3456789000e10-- +bool(true) + +--float .5-- +bool(true) + +--empty array-- +bool(true) + +--int indexed array-- +bool(true) + +--associative array-- +bool(true) + +--nested arrays-- +bool(true) + +--uppercase NULL-- +bool(true) + +--lowercase null-- +bool(true) + +--lowercase true-- +bool(true) + +--lowercase false-- +bool(true) + +--uppercase TRUE-- +bool(true) + +--uppercase FALSE-- +bool(true) + +--empty string DQ-- +bool(true) + +--empty string SQ-- +bool(true) + +--string DQ-- +bool(true) + +--string SQ-- +bool(true) + +--mixed case string-- +bool(true) + +--heredoc-- +bool(true) + +--instance of classWithToString-- +Error: 8 - Object of class classWithToString could not be converted to int, %s(%d) +bool(true) + +--instance of classWithoutToString-- +Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d) +bool(true) + +--undefined var-- +bool(true) + +--unset var-- +bool(true) +===DONE=== diff --git a/ext/standard/tests/file/touch_variation3.phpt b/ext/standard/tests/file/touch_variation3.phpt new file mode 100644 index 0000000000..3e4f7763c7 --- /dev/null +++ b/ext/standard/tests/file/touch_variation3.phpt @@ -0,0 +1,196 @@ +--TEST-- +Test touch() function : usage variation - different types for time +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for time + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( touch($filename, $value, $atime) ); +}; + +unlink($filename); + +?> +===DONE=== +--EXPECTF-- +*** Testing touch() : usage variation *** + +--float 10.5-- +bool(true) + +--float -10.5-- +bool(true) + +--float 12.3456789000e10-- +bool(true) + +--float -12.3456789000e10-- +bool(true) + +--float .5-- +bool(true) + +--empty array-- +bool(true) + +--int indexed array-- +bool(true) + +--associative array-- +bool(true) + +--nested arrays-- +bool(true) + +--uppercase NULL-- +bool(true) + +--lowercase null-- +bool(true) + +--lowercase true-- +bool(true) + +--lowercase false-- +bool(true) + +--uppercase TRUE-- +bool(true) + +--uppercase FALSE-- +bool(true) + +--empty string DQ-- +bool(true) + +--empty string SQ-- +bool(true) + +--string DQ-- +bool(true) + +--string SQ-- +bool(true) + +--mixed case string-- +bool(true) + +--heredoc-- +bool(true) + +--instance of classWithToString-- +Error: 8 - Object of class classWithToString could not be converted to int, %s(%d) +bool(true) + +--instance of classWithoutToString-- +Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d) +bool(true) + +--undefined var-- +bool(true) + +--unset var-- +bool(true) +===DONE=== diff --git a/ext/standard/tests/file/touch_variation4-win32.phpt b/ext/standard/tests/file/touch_variation4-win32.phpt new file mode 100644 index 0000000000..49cf8d576d --- /dev/null +++ b/ext/standard/tests/file/touch_variation4-win32.phpt @@ -0,0 +1,198 @@ +--TEST-- +Test touch() function : usage variation - different types for atime +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for atime + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( touch($filename, $time, $value) ); +}; + +unlink($filename); + +?> +===DONE=== +--EXPECTF-- +*** Testing touch() : usage variation *** + +--float 10.5-- +bool(true) + +--float -10.5-- +Error: 2 - touch(): Utime failed: Invalid argument, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - touch(): Utime failed: Invalid argument, %s(%d) +bool(false) + +--float -12.3456789000e10-- +bool(true) + +--float .5-- +bool(true) + +--empty array-- +bool(true) + +--int indexed array-- +bool(true) + +--associative array-- +bool(true) + +--nested arrays-- +bool(true) + +--uppercase NULL-- +bool(true) + +--lowercase null-- +bool(true) + +--lowercase true-- +bool(true) + +--lowercase false-- +bool(true) + +--uppercase TRUE-- +bool(true) + +--uppercase FALSE-- +bool(true) + +--empty string DQ-- +bool(true) + +--empty string SQ-- +bool(true) + +--string DQ-- +bool(true) + +--string SQ-- +bool(true) + +--mixed case string-- +bool(true) + +--heredoc-- +bool(true) + +--instance of classWithToString-- +Error: 8 - Object of class classWithToString could not be converted to int, %s(%d) +bool(true) + +--instance of classWithoutToString-- +Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d) +bool(true) + +--undefined var-- +bool(true) + +--unset var-- +bool(true) +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/touch_variation4.phpt b/ext/standard/tests/file/touch_variation4.phpt new file mode 100644 index 0000000000..c71298a6e4 --- /dev/null +++ b/ext/standard/tests/file/touch_variation4.phpt @@ -0,0 +1,196 @@ +--TEST-- +Test touch() function : usage variation - different types for atime +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for atime + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( touch($filename, $time, $value) ); +}; + +unlink($filename); + +?> +===DONE=== +--EXPECTF-- +*** Testing touch() : usage variation *** + +--float 10.5-- +bool(true) + +--float -10.5-- +bool(true) + +--float 12.3456789000e10-- +bool(true) + +--float -12.3456789000e10-- +bool(true) + +--float .5-- +bool(true) + +--empty array-- +bool(true) + +--int indexed array-- +bool(true) + +--associative array-- +bool(true) + +--nested arrays-- +bool(true) + +--uppercase NULL-- +bool(true) + +--lowercase null-- +bool(true) + +--lowercase true-- +bool(true) + +--lowercase false-- +bool(true) + +--uppercase TRUE-- +bool(true) + +--uppercase FALSE-- +bool(true) + +--empty string DQ-- +bool(true) + +--empty string SQ-- +bool(true) + +--string DQ-- +bool(true) + +--string SQ-- +bool(true) + +--mixed case string-- +bool(true) + +--heredoc-- +bool(true) + +--instance of classWithToString-- +Error: 8 - Object of class classWithToString could not be converted to int, %s(%d) +bool(true) + +--instance of classWithoutToString-- +Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d) +bool(true) + +--undefined var-- +bool(true) + +--unset var-- +bool(true) +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/touch_variation5-win32.phpt b/ext/standard/tests/file/touch_variation5-win32.phpt new file mode 100644 index 0000000000..6b7bde4c4a --- /dev/null +++ b/ext/standard/tests/file/touch_variation5-win32.phpt @@ -0,0 +1,249 @@ +--TEST-- +Test touch() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +===DONE=== +--EXPECTF-- +*** Testing touch() : variation *** + +*** testing nonexisting paths *** +--- testing touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/aSubDirOrFile - created +--- testing ./touchVar5.tmp/aSubDirOrFile --- +PASSED: ./touchVar5.tmp/aSubDirOrFile - created +--- testing touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - created +--- testing touchVar5.tmp/../BADDIR/aSubDirOrFile --- + +Warning: touch(): Unable to create file touchVar5.tmp/../BADDIR/aSubDirOrFile because %s in %s on line %d +--- testing BADDIR/aSubDirOrFile --- + +Warning: touch(): Unable to create file BADDIR/aSubDirOrFile because %s in %s on line %d +--- testing %s/touchVar5.tmp/aSubDirOrFile --- +PASSED: %s/touchVar5.tmp/aSubDirOrFile - created +--- testing %s/./touchVar5.tmp/aSubDirOrFile --- +PASSED: %s/./touchVar5.tmp/aSubDirOrFile - created +--- testing %s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: %s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - created +--- testing %s/BADDIR/aSubDirOrFile --- + +Warning: touch(): Unable to create file %s/BADDIR/aSubDirOrFile because %s in %s on line %d +--- testing touchVar5.tmp/aSubDirOrFile/ --- + +Warning: touch(): Unable to create file touchVar5.tmp/aSubDirOrFile/ because Invalid argument in %s on line %d +--- testing %s/touchVar5.tmp/aSubDirOrFile/ --- + +Warning: touch(): Unable to create file %s/touchVar5.tmp/aSubDirOrFile/ because Invalid argument in %s on line %d +--- testing touchVar5.tmp//aSubDirOrFile --- +PASSED: touchVar5.tmp//aSubDirOrFile - created +--- testing %s//touchVar5.tmp//aSubDirOrFile --- +PASSED: %s//touchVar5.tmp//aSubDirOrFile - created + +*** testing existing files *** +--- testing touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/aSubDirOrFile - touched +--- testing ./touchVar5.tmp/aSubDirOrFile --- +PASSED: ./touchVar5.tmp/aSubDirOrFile - touched +--- testing touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - touched +--- testing %s/touchVar5.tmp/aSubDirOrFile --- +PASSED: %s/touchVar5.tmp/aSubDirOrFile - touched +--- testing %s/./touchVar5.tmp/aSubDirOrFile --- +PASSED: %s/./touchVar5.tmp/aSubDirOrFile - touched +--- testing %s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: %s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - touched +--- testing touchVar5.tmp//aSubDirOrFile --- +PASSED: touchVar5.tmp//aSubDirOrFile - touched +--- testing %s//touchVar5.tmp//aSubDirOrFile --- +PASSED: %s//touchVar5.tmp//aSubDirOrFile - touched + +*** testing existing directories *** +--- testing touchVar5.tmp/aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: touchVar5.tmp/aSubDirOrFile - access time not changed +--- testing ./touchVar5.tmp/aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: ./touchVar5.tmp/aSubDirOrFile - access time not changed +--- testing touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - access time not changed +--- testing %s/touchVar5.tmp/aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: %s/touchVar5.tmp/aSubDirOrFile - access time not changed +--- testing %s/./touchVar5.tmp/aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: %s/./touchVar5.tmp/aSubDirOrFile - access time not changed +--- testing %s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: %s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - access time not changed +--- testing touchVar5.tmp/aSubDirOrFile/ --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: touchVar5.tmp/aSubDirOrFile/ - access time not changed +--- testing %s/touchVar5.tmp/aSubDirOrFile/ --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: %s/touchVar5.tmp/aSubDirOrFile/ - access time not changed +--- testing touchVar5.tmp//aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: touchVar5.tmp//aSubDirOrFile - access time not changed +--- testing %s//touchVar5.tmp//aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: %s//touchVar5.tmp//aSubDirOrFile - access time not changed +===DONE=== + diff --git a/ext/standard/tests/file/touch_variation5.phpt b/ext/standard/tests/file/touch_variation5.phpt new file mode 100644 index 0000000000..f0e1f78691 --- /dev/null +++ b/ext/standard/tests/file/touch_variation5.phpt @@ -0,0 +1,230 @@ +--TEST-- +Test touch() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing touch() : variation *** + +*** testing nonexisting paths *** +--- testing touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/aSubDirOrFile - created +--- testing ./touchVar5.tmp/aSubDirOrFile --- +PASSED: ./touchVar5.tmp/aSubDirOrFile - created +--- testing touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - created +--- testing touchVar5.tmp/../BADDIR/aSubDirOrFile --- + +Warning: touch(): Unable to create file touchVar5.tmp/../BADDIR/aSubDirOrFile because %s in %s on line %d +--- testing BADDIR/aSubDirOrFile --- + +Warning: touch(): Unable to create file BADDIR/aSubDirOrFile because %s in %s on line %d +--- testing /%s/touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/touchVar5.tmp/aSubDirOrFile - created +--- testing /%s/./touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/./touchVar5.tmp/aSubDirOrFile - created +--- testing /%s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - created +--- testing /%s/BADDIR/aSubDirOrFile --- + +Warning: touch(): Unable to create file /%s/BADDIR/aSubDirOrFile because %s in %s on line %d +--- testing touchVar5.tmp/aSubDirOrFile/ --- + +Warning: touch(): Unable to create file touchVar5.tmp/aSubDirOrFile/ because Is a directory in %s on line %d +--- testing /%s/touchVar5.tmp/aSubDirOrFile/ --- + +Warning: touch(): Unable to create file /%s/touchVar5.tmp/aSubDirOrFile/ because Is a directory in %s on line %d +--- testing touchVar5.tmp//aSubDirOrFile --- +PASSED: touchVar5.tmp//aSubDirOrFile - created +--- testing /%s//touchVar5.tmp//aSubDirOrFile --- +PASSED: /%s//touchVar5.tmp//aSubDirOrFile - created + +*** testing existing files *** +--- testing touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/aSubDirOrFile - touched +--- testing ./touchVar5.tmp/aSubDirOrFile --- +PASSED: ./touchVar5.tmp/aSubDirOrFile - touched +--- testing touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - touched +--- testing /%s/touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/touchVar5.tmp/aSubDirOrFile - touched +--- testing /%s/./touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/./touchVar5.tmp/aSubDirOrFile - touched +--- testing /%s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - touched +--- testing touchVar5.tmp//aSubDirOrFile --- +PASSED: touchVar5.tmp//aSubDirOrFile - touched +--- testing /%s//touchVar5.tmp//aSubDirOrFile --- +PASSED: /%s//touchVar5.tmp//aSubDirOrFile - touched + +*** testing existing directories *** +--- testing touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/aSubDirOrFile - touched +--- testing ./touchVar5.tmp/aSubDirOrFile --- +PASSED: ./touchVar5.tmp/aSubDirOrFile - touched +--- testing touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - touched +--- testing /%s/touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/touchVar5.tmp/aSubDirOrFile - touched +--- testing /%s/./touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/./touchVar5.tmp/aSubDirOrFile - touched +--- testing /%s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/touchVar5.tmp/../touchVar5.tmp/aSubDirOrFile - touched +--- testing touchVar5.tmp/aSubDirOrFile/ --- +PASSED: touchVar5.tmp/aSubDirOrFile/ - touched +--- testing /%s/touchVar5.tmp/aSubDirOrFile/ --- +PASSED: /%s/touchVar5.tmp/aSubDirOrFile/ - touched +--- testing touchVar5.tmp//aSubDirOrFile --- +PASSED: touchVar5.tmp//aSubDirOrFile - touched +--- testing /%s//touchVar5.tmp//aSubDirOrFile --- +PASSED: /%s//touchVar5.tmp//aSubDirOrFile - touched +===DONE=== + diff --git a/ext/standard/tests/file/touch_variation6-win32.phpt b/ext/standard/tests/file/touch_variation6-win32.phpt new file mode 100644 index 0000000000..8c87d49048 --- /dev/null +++ b/ext/standard/tests/file/touch_variation6-win32.phpt @@ -0,0 +1,263 @@ +--TEST-- +Test touch() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing touch() : variation *** + +*** testing nonexisting paths *** +--- testing touchVar5.tmp\aSubDirOrFile --- +PASSED: touchVar5.tmp\aSubDirOrFile - created +--- testing .\touchVar5.tmp\aSubDirOrFile --- +PASSED: .\touchVar5.tmp\aSubDirOrFile - created +--- testing touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile --- +PASSED: touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile - created +--- testing touchVar5.tmp\..\BADDIR\aSubDirOrFile --- + +Warning: touch(): Unable to create file touchVar5.tmp\..\BADDIR\aSubDirOrFile because %s in %s on line %d +--- testing BADDIR\aSubDirOrFile --- + +Warning: touch(): Unable to create file BADDIR\aSubDirOrFile because %s in %s on line %d +--- testing %s\touchVar5.tmp\aSubDirOrFile --- +PASSED: %s\touchVar5.tmp\aSubDirOrFile - created +--- testing %s\.\touchVar5.tmp\aSubDirOrFile --- +PASSED: %s\.\touchVar5.tmp\aSubDirOrFile - created +--- testing %s\touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile --- +PASSED: %s\touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile - created +--- testing %s\BADDIR\aSubDirOrFile --- + +Warning: touch(): Unable to create file %s\BADDIR\aSubDirOrFile because %s in %s on line %d +--- testing touchVar5.tmp\aSubDirOrFile\ --- + +Warning: touch(): Unable to create file touchVar5.tmp\aSubDirOrFile\ because Invalid argument in %s on line %d +--- testing %s\touchVar5.tmp\aSubDirOrFile\ --- + +Warning: touch(): Unable to create file %s\touchVar5.tmp\aSubDirOrFile\ because Invalid argument in %s on line %d +--- testing touchVar5.tmp\\aSubDirOrFile --- +PASSED: touchVar5.tmp\\aSubDirOrFile - created +--- testing %s\\touchVar5.tmp\\aSubDirOrFile --- +PASSED: %s\\touchVar5.tmp\\aSubDirOrFile - created +--- testing /%s/touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/touchVar5.tmp/aSubDirOrFile - created + +*** testing existing files *** +--- testing touchVar5.tmp\aSubDirOrFile --- +PASSED: touchVar5.tmp\aSubDirOrFile - touched +--- testing .\touchVar5.tmp\aSubDirOrFile --- +PASSED: .\touchVar5.tmp\aSubDirOrFile - touched +--- testing touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile --- +PASSED: touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile - touched +--- testing %s\touchVar5.tmp\aSubDirOrFile --- +PASSED: %s\touchVar5.tmp\aSubDirOrFile - touched +--- testing %s\.\touchVar5.tmp\aSubDirOrFile --- +PASSED: %s\.\touchVar5.tmp\aSubDirOrFile - touched +--- testing %s\touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile --- +PASSED: %s\touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile - touched +--- testing touchVar5.tmp\\aSubDirOrFile --- +PASSED: touchVar5.tmp\\aSubDirOrFile - touched +--- testing %s\\touchVar5.tmp\\aSubDirOrFile --- +PASSED: %s\\touchVar5.tmp\\aSubDirOrFile - touched +--- testing /%s/touchVar5.tmp/aSubDirOrFile --- +PASSED: /%s/touchVar5.tmp/aSubDirOrFile - touched + +*** testing existing directories *** +--- testing touchVar5.tmp\aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: touchVar5.tmp\aSubDirOrFile - access time not changed +--- testing .\touchVar5.tmp\aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: .\touchVar5.tmp\aSubDirOrFile - access time not changed +--- testing touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile - access time not changed +--- testing %s\touchVar5.tmp\aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: %s\touchVar5.tmp\aSubDirOrFile - access time not changed +--- testing %s\.\touchVar5.tmp\aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: %s\.\touchVar5.tmp\aSubDirOrFile - access time not changed +--- testing %s\touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: %s\touchVar5.tmp\..\touchVar5.tmp\aSubDirOrFile - access time not changed +--- testing touchVar5.tmp\aSubDirOrFile\ --- + +Warning: touch(): Utime failed: No such file or directory in %s on line %d +FAILED: touchVar5.tmp\aSubDirOrFile\ - access time not changed +--- testing %s\touchVar5.tmp\aSubDirOrFile\ --- + +Warning: touch(): Utime failed: No such file or directory in %s on line %d +FAILED: %s\touchVar5.tmp\aSubDirOrFile\ - access time not changed +--- testing touchVar5.tmp\\aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: touchVar5.tmp\\aSubDirOrFile - access time not changed +--- testing %s\\touchVar5.tmp\\aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: %s\\touchVar5.tmp\\aSubDirOrFile - access time not changed +--- testing /%s/touchVar5.tmp/aSubDirOrFile --- + +Warning: touch(): Utime failed: Permission denied in %s on line %d +FAILED: /%s/touchVar5.tmp/aSubDirOrFile - access time not changed +===DONE=== + diff --git a/ext/standard/tests/file/umask_variation3.phpt b/ext/standard/tests/file/umask_variation3.phpt new file mode 100644 index 0000000000..b5b1c2e0fb --- /dev/null +++ b/ext/standard/tests/file/umask_variation3.phpt @@ -0,0 +1,226 @@ +--TEST-- +Test umask() function : usage variation +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + //out of boundary integers + 'int -100' => -100, + 'int 99999' => 99999, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + //'float -12.3456789000e10' => -12.3456789000e10, different in p8 + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, +); + +// loop through each element of the array for mask + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + umask(0); + var_dump(umask($value)); + var_dump( umask()); +}; + +?> +===DONE=== +--EXPECTF-- +*** Testing umask() : usage variation *** + +--int -100-- +int(0) +int(412) + +--int 99999-- +int(0) +int(159) + +--float 10.5-- +int(0) +int(10) + +--float -10.5-- +int(0) +int(502) + +--float 12.3456789000e10-- +int(0) +int(8) + +--float .5-- +int(0) +int(0) + +--empty array-- +int(0) +int(0) + +--int indexed array-- +int(0) +int(1) + +--associative array-- +int(0) +int(1) + +--nested arrays-- +int(0) +int(1) + +--uppercase NULL-- +int(0) +int(0) + +--lowercase null-- +int(0) +int(0) + +--lowercase true-- +int(0) +int(1) + +--lowercase false-- +int(0) +int(0) + +--uppercase TRUE-- +int(0) +int(1) + +--uppercase FALSE-- +int(0) +int(0) + +--empty string DQ-- +int(0) +int(0) + +--empty string SQ-- +int(0) +int(0) + +--string DQ-- +int(0) +int(0) + +--string SQ-- +int(0) +int(0) + +--mixed case string-- +int(0) +int(0) + +--heredoc-- +int(0) +int(0) + +--instance of classWithToString-- +Error: 8 - Object of class classWithToString could not be converted to int, %s(%d) +int(0) +int(1) + +--instance of classWithoutToString-- +Error: 8 - Object of class classWithoutToString could not be converted to int, %s(%d) +int(0) +int(1) + +--undefined var-- +int(0) +int(0) + +--unset var-- +int(0) +int(0) +===DONE=== diff --git a/ext/standard/tests/file/unlink_variation10.phpt b/ext/standard/tests/file/unlink_variation10.phpt new file mode 100644 index 0000000000..e0c92caeba --- /dev/null +++ b/ext/standard/tests/file/unlink_variation10.phpt @@ -0,0 +1,106 @@ +--TEST-- +Test unlink() function : variation: unlinking directories +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing unlink() : variation *** +-- unlinking soft link unlinkVar8.tmp/subDir.tmp -- +directory unlinked +-- unlinking soft link ./unlinkVar8.tmp/subDir.tmp -- +directory unlinked +-- unlinking soft link unlinkVar8.tmp/../unlinkVar8.tmp/subDir.tmp -- +directory unlinked +-- unlinking soft link /%s/unlinkVar8.tmp/subDir.tmp -- +directory unlinked +-- unlinking soft link /%s/./unlinkVar8.tmp/subDir.tmp -- +directory unlinked +-- unlinking soft link /%s/unlinkVar8.tmp/../unlinkVar8.tmp/subDir.tmp -- +directory unlinked +-- unlinking soft link unlinkVar8.tmp//subDir.tmp -- +directory unlinked +-- unlinking soft link /%s//unlinkVar8.tmp//subDir.tmp -- +directory unlinked + +--- try to unlink a directory --- + +Warning: unlink(unlinkVar8.tmp/linkme.tmp): %s in %s on line %d +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/unlink_variation6.phpt b/ext/standard/tests/file/unlink_variation6.phpt new file mode 100644 index 0000000000..ede9ada092 --- /dev/null +++ b/ext/standard/tests/file/unlink_variation6.phpt @@ -0,0 +1,41 @@ +--TEST-- +Test unlink() function : variation +--CREDITS-- +Dave Kelsey +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing unlink() : variation: contexts and relative files *** +subdir/testfile.txt exists +bool(true) +subdir/testfile.txt doesn't exist +===DONE=== diff --git a/ext/standard/tests/file/unlink_variation7.phpt b/ext/standard/tests/file/unlink_variation7.phpt new file mode 100644 index 0000000000..4c63e11c85 --- /dev/null +++ b/ext/standard/tests/file/unlink_variation7.phpt @@ -0,0 +1,246 @@ +--TEST-- +Test unlink() function : usage variation different types for context +--CREDITS-- +Dave Kelsey +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // file resource + 'file resource' => $fileRes +); + +// loop through each element of the array for context + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + touch($filename); // create if it doesn't exist + var_dump( unlink($filename, $value) ); +}; + +if (file_exists($filename)) { + unlink($filename); +} +fclose($fileRes); + +?> +===DONE=== +--EXPECTF-- +*** Testing unlink() : usage variation different types for context *** + +--int 0-- +Error: 2 - unlink() expects parameter 2 to be resource, integer given, %s(%d) +bool(false) + +--int 1-- +Error: 2 - unlink() expects parameter 2 to be resource, integer given, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - unlink() expects parameter 2 to be resource, integer given, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - unlink() expects parameter 2 to be resource, integer given, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - unlink() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - unlink() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - unlink() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - unlink() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--float .5-- +Error: 2 - unlink() expects parameter 2 to be resource, double given, %s(%d) +bool(false) + +--empty array-- +Error: 2 - unlink() expects parameter 2 to be resource, array given, %s(%d) +bool(false) + +--int indexed array-- +Error: 2 - unlink() expects parameter 2 to be resource, array given, %s(%d) +bool(false) + +--associative array-- +Error: 2 - unlink() expects parameter 2 to be resource, array given, %s(%d) +bool(false) + +--nested arrays-- +Error: 2 - unlink() expects parameter 2 to be resource, array given, %s(%d) +bool(false) + +--uppercase NULL-- +Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - unlink() expects parameter 2 to be resource, boolean given, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - unlink() expects parameter 2 to be resource, boolean given, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - unlink() expects parameter 2 to be resource, boolean given, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - unlink() expects parameter 2 to be resource, boolean given, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - unlink() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - unlink() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--string DQ-- +Error: 2 - unlink() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--string SQ-- +Error: 2 - unlink() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--mixed case string-- +Error: 2 - unlink() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--heredoc-- +Error: 2 - unlink() expects parameter 2 to be resource, string given, %s(%d) +bool(false) + +--instance of classWithToString-- +Error: 2 - unlink() expects parameter 2 to be resource, object given, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - unlink() expects parameter 2 to be resource, object given, %s(%d) +bool(false) + +--undefined var-- +Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) +bool(false) + +--unset var-- +Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) +bool(false) + +--file resource-- +Error: 2 - unlink(): supplied resource is not a valid Stream-Context resource, %s(%d) +bool(true) +===DONE=== diff --git a/ext/standard/tests/file/unlink_variation8-win32.phpt b/ext/standard/tests/file/unlink_variation8-win32.phpt new file mode 100644 index 0000000000..5348676e40 --- /dev/null +++ b/ext/standard/tests/file/unlink_variation8-win32.phpt @@ -0,0 +1,112 @@ +--TEST-- +Test unlink() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing unlink() : variation *** +-- removing unlinkVar8.tmp/file.tmp -- +file removed +-- removing ./unlinkVar8.tmp/file.tmp -- +file removed +-- removing unlinkVar8.tmp/../unlinkVar8.tmp/file.tmp -- +file removed +-- removing unlinkVar8.tmp/../BADDIR/file.tmp -- + +Warning: unlink(unlinkVar8.tmp/../BADDIR/file.tmp): No such file or directory in %s on line %d +-- removing BADDIR/file.tmp -- + +Warning: unlink(BADDIR/file.tmp): No such file or directory in %s on line %d +-- removing %s/unlinkVar8.tmp/file.tmp -- +file removed +-- removing %s/./unlinkVar8.tmp/file.tmp -- +file removed +-- removing %s/unlinkVar8.tmp/../unlinkVar8.tmp/file.tmp -- +file removed +-- removing %s/BADDIR/file.tmp -- + +Warning: unlink(%s/BADDIR/file.tmp): No such file or directory in %s on line %d +-- removing unlinkVar8.tmp/file.tmp/ -- + +Warning: unlink(unlinkVar8.tmp/file.tmp/): Invalid argument in %s on line %d +-- removing %s/unlinkVar8.tmp/file.tmp/ -- + +Warning: unlink(%s/unlinkVar8.tmp/file.tmp/): Invalid argument in %s on line %d +-- removing unlinkVar8.tmp//file.tmp -- +file removed +-- removing %s//unlinkVar8.tmp//file.tmp -- +file removed +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/unlink_variation8.phpt b/ext/standard/tests/file/unlink_variation8.phpt new file mode 100644 index 0000000000..e87a584f5b --- /dev/null +++ b/ext/standard/tests/file/unlink_variation8.phpt @@ -0,0 +1,206 @@ +--TEST-- +Test unlink() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing unlink() : variation *** +-- removing unlinkVar8.tmp/file.tmp -- +file removed +-- unlinking soft link unlinkVar8.tmp/file.tmp -- +file unlinked +-- unlinking hard link unlinkVar8.tmp/file.tmp -- +file unlinked +-- removing ./unlinkVar8.tmp/file.tmp -- +file removed +-- unlinking soft link ./unlinkVar8.tmp/file.tmp -- +file unlinked +-- unlinking hard link ./unlinkVar8.tmp/file.tmp -- +file unlinked +-- removing unlinkVar8.tmp/../unlinkVar8.tmp/file.tmp -- +file removed +-- unlinking soft link unlinkVar8.tmp/../unlinkVar8.tmp/file.tmp -- +file unlinked +-- unlinking hard link unlinkVar8.tmp/../unlinkVar8.tmp/file.tmp -- +file unlinked +-- removing unlinkVar8.tmp/../BADDIR/file.tmp -- + +Warning: unlink(unlinkVar8.tmp/../BADDIR/file.tmp): No such file or directory in %s on line %d +-- unlinking soft link unlinkVar8.tmp/../BADDIR/file.tmp -- + +Warning: unlink(unlinkVar8.tmp/../BADDIR/file.tmp): No such file or directory in %s on line %d +-- unlinking hard link unlinkVar8.tmp/../BADDIR/file.tmp -- + +Warning: unlink(unlinkVar8.tmp/../BADDIR/file.tmp): No such file or directory in %s on line %d +-- removing BADDIR/file.tmp -- + +Warning: unlink(BADDIR/file.tmp): No such file or directory in %s on line %d +-- unlinking soft link BADDIR/file.tmp -- + +Warning: unlink(BADDIR/file.tmp): No such file or directory in %s on line %d +-- unlinking hard link BADDIR/file.tmp -- + +Warning: unlink(BADDIR/file.tmp): No such file or directory in %s on line %d +-- removing /%s/unlinkVar8.tmp/file.tmp -- +file removed +-- unlinking soft link /%s/unlinkVar8.tmp/file.tmp -- +file unlinked +-- unlinking hard link /%s/unlinkVar8.tmp/file.tmp -- +file unlinked +-- removing /%s/./unlinkVar8.tmp/file.tmp -- +file removed +-- unlinking soft link /%s/./unlinkVar8.tmp/file.tmp -- +file unlinked +-- unlinking hard link /%s/./unlinkVar8.tmp/file.tmp -- +file unlinked +-- removing /%s/unlinkVar8.tmp/../unlinkVar8.tmp/file.tmp -- +file removed +-- unlinking soft link /%s/unlinkVar8.tmp/../unlinkVar8.tmp/file.tmp -- +file unlinked +-- unlinking hard link /%s/unlinkVar8.tmp/../unlinkVar8.tmp/file.tmp -- +file unlinked +-- removing /%s/BADDIR/file.tmp -- + +Warning: unlink(/%s/BADDIR/file.tmp): No such file or directory in %s on line %d +-- unlinking soft link /%s/BADDIR/file.tmp -- + +Warning: unlink(/%s/BADDIR/file.tmp): No such file or directory in %s on line %d +-- unlinking hard link /%s/BADDIR/file.tmp -- + +Warning: unlink(/%s/BADDIR/file.tmp): No such file or directory in %s on line %d +-- removing unlinkVar8.tmp/file.tmp/ -- + +Warning: unlink(unlinkVar8.tmp/file.tmp/): Not a directory in %s on line %d +-- unlinking soft link unlinkVar8.tmp/file.tmp/ -- + +Warning: unlink(unlinkVar8.tmp/file.tmp/): Not a directory in %s on line %d +-- unlinking hard link unlinkVar8.tmp/file.tmp/ -- + +Warning: unlink(unlinkVar8.tmp/file.tmp/): Not a directory in %s on line %d +-- removing /%s/unlinkVar8.tmp/file.tmp/ -- + +Warning: unlink(/%s/unlinkVar8.tmp/file.tmp/): Not a directory in %s on line %d +-- unlinking soft link /%s/unlinkVar8.tmp/file.tmp/ -- + +Warning: unlink(/%s/unlinkVar8.tmp/file.tmp/): Not a directory in %s on line %d +-- unlinking hard link /%s/unlinkVar8.tmp/file.tmp/ -- + +Warning: unlink(/%s/unlinkVar8.tmp/file.tmp/): Not a directory in %s on line %d +-- removing unlinkVar8.tmp//file.tmp -- +file removed +-- unlinking soft link unlinkVar8.tmp//file.tmp -- +file unlinked +-- unlinking hard link unlinkVar8.tmp//file.tmp -- +file unlinked +-- removing /%s//unlinkVar8.tmp//file.tmp -- +file removed +-- unlinking soft link /%s//unlinkVar8.tmp//file.tmp -- +file unlinked +-- unlinking hard link /%s//unlinkVar8.tmp//file.tmp -- +file unlinked +===DONE=== \ No newline at end of file diff --git a/ext/standard/tests/file/unlink_variation9-win32.phpt b/ext/standard/tests/file/unlink_variation9-win32.phpt new file mode 100644 index 0000000000..4f1a8bb8d3 --- /dev/null +++ b/ext/standard/tests/file/unlink_variation9-win32.phpt @@ -0,0 +1,120 @@ +--TEST-- +Test unlink() function : variation: various valid and invalid paths +--CREDITS-- +Dave Kelsey +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing unlink() : variation *** +-- removing unlinkVar9.tmp\file.tmp -- +file removed +-- removing .\unlinkVar9.tmp\file.tmp -- +file removed +-- removing unlinkVar9.tmp\..\unlinkVar9.tmp\file.tmp -- +file removed +-- removing unlinkVar9.tmp\..\BADDIR\file.tmp -- + +Warning: unlink(unlinkVar9.tmp\..\BADDIR\file.tmp): No such file or directory in %s on line %d +-- removing BADDIR\file.tmp -- + +Warning: unlink(BADDIR\file.tmp): No such file or directory in %s on line %d +-- removing %s\unlinkVar9.tmp\file.tmp -- +file removed +-- removing %s\.\unlinkVar9.tmp\file.tmp -- +file removed +-- removing %s\unlinkVar9.tmp\..\unlinkVar9.tmp\file.tmp -- +file removed +-- removing %s\BADDIR\file.tmp -- + +Warning: unlink(%s\BADDIR\file.tmp): No such file or directory in %s on line %d +-- removing unlinkVar9.tmp\file.tmp\ -- + +Warning: unlink(unlinkVar9.tmp\file.tmp\): Invalid argument in %s on line %d +-- removing %s\unlinkVar9.tmp\file.tmp\ -- + +Warning: unlink(%s\unlinkVar9.tmp\file.tmp\): Invalid argument in %s on line %d +-- removing unlinkVar9.tmp\\file.tmp -- +file removed +-- removing %s\\unlinkVar9.tmp\\file.tmp -- +file removed +-- removing /%s/unlinkVar9.tmp/file.tmp -- +file removed +===DONE=== \ No newline at end of file