diff options
-rw-r--r-- | ext/standard/tests/file/file_get_contents_variation8-win32.phpt | 77 | ||||
-rw-r--r-- | ext/standard/tests/file/file_put_contents_variation8-win32.phpt | bin | 2147 -> 2583 bytes | |||
-rw-r--r-- | ext/standard/tests/file/readfile_variation10-win32.phpt | bin | 1785 -> 2095 bytes |
3 files changed, 46 insertions, 31 deletions
diff --git a/ext/standard/tests/file/file_get_contents_variation8-win32.phpt b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt index de471d30a2..38cbe5d775 100644 --- a/ext/standard/tests/file/file_get_contents_variation8-win32.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt @@ -1,7 +1,5 @@ --TEST-- Test file_get_contents() function : variation - obscure filenames ---XFAIL-- -Return values are inconsistent (and have changed from previous versions) --CREDITS-- Dave Kelsey <d_kelsey@uk.ibm.com> --SKIPIF-- @@ -18,67 +16,84 @@ if(substr(PHP_OS, 0, 3) != "WIN") */ echo "*** Testing file_get_contents() : variation ***\n"; + /* An array of filenames */ $names_arr = array( /* Invalid args */ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - array(), - - /* prefix with path separator of a non existing directory*/ - "/no/such/file/dir", - "php/php" + "-1" => -1, + "TRUE" => TRUE, + "FALSE" => FALSE, + "NULL" => NULL, + "\"\"" => "", + "\" \"" => " ", + "\\0" => "\0", + "array()" => array(), + + /* prefix with path separator of a non existing directory*/ + "/no/such/file/dir" => "/no/such/file/dir", + "php/php"=> "php/php" ); -for( $i=0; $i<count($names_arr); $i++ ) { - echo "-- Iteration $i --\n"; - var_dump(file_get_contents($names_arr[$i])); +foreach($names_arr as $key =>$value) { + echo "\n-- Filename: $key --\n"; + var_dump(file_get_contents($value)); } -echo "\n*** Done ***\n"; ?> +===Done=== --EXPECTF-- *** Testing file_get_contents() : variation *** --- Iteration 0 -- + +-- Filename: -1 -- Warning: file_get_contents(-1): failed to open stream: No such file or directory in %s on line %d bool(false) --- Iteration 1 -- + +-- Filename: TRUE -- Warning: file_get_contents(1): failed to open stream: No such file or directory in %s on line %d bool(false) --- Iteration 2 -- + +-- Filename: FALSE -- + +Warning: file_get_contents(): Filename cannot be empty in %s on line %d bool(false) --- Iteration 3 -- + +-- Filename: NULL -- + +Warning: file_get_contents(): Filename cannot be empty in %s on line %d bool(false) --- Iteration 4 -- + +-- Filename: "" -- + +Warning: file_get_contents(): Filename cannot be empty in %s on line %d bool(false) --- Iteration 5 -- + +-- Filename: " " -- Warning: file_get_contents( ): failed to open stream: Permission denied in %s on line %d bool(false) --- Iteration 6 -- + +-- Filename: \0 -- + +Warning: file_get_contents(): Filename cannot be empty in %s on line %d bool(false) --- Iteration 7 -- + +-- Filename: array() -- Notice: Array to string conversion in %s on line %d Warning: file_get_contents(Array): failed to open stream: No such file or directory in %s on line %d bool(false) --- Iteration 8 -- + +-- Filename: /no/such/file/dir -- 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 -- + +-- Filename: php/php -- Warning: file_get_contents(php/php): failed to open stream: No such file or directory in %s on line %d bool(false) - -*** Done *** - +===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 Binary files differindex b762deea85..c13b0f7311 100644 --- a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt diff --git a/ext/standard/tests/file/readfile_variation10-win32.phpt b/ext/standard/tests/file/readfile_variation10-win32.phpt Binary files differindex d9073a76f3..1a86c2aa4e 100644 --- a/ext/standard/tests/file/readfile_variation10-win32.phpt +++ b/ext/standard/tests/file/readfile_variation10-win32.phpt |