]> granicus.if.org Git - php/commitdiff
Fix Windows tests after #47037
authorandy wharmby <wharmby@php.net>
Mon, 12 Jan 2009 15:58:41 +0000 (15:58 +0000)
committerandy wharmby <wharmby@php.net>
Mon, 12 Jan 2009 15:58:41 +0000 (15:58 +0000)
ext/standard/tests/file/file_get_contents_variation8-win32.phpt
ext/standard/tests/file/file_put_contents_variation8-win32.phpt
ext/standard/tests/file/readfile_variation10-win32.phpt

index de471d30a22462bc3f371d92a2ce40e081446916..38cbe5d775dcb15f286e0d479efb92c9430fb2d9 100644 (file)
@@ -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
index b762deea85f939513e3d7ba503851865dc53a430..c13b0f73110f738880d2a2329a83bcb4e5729031 100644 (file)
Binary files a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt and b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt differ
index d9073a76f32e055a37934df6b5435352747e2e8e..1a86c2aa4e92ca6d0ba2f3f2c2145ce3187fc880 100644 (file)
Binary files a/ext/standard/tests/file/readfile_variation10-win32.phpt and b/ext/standard/tests/file/readfile_variation10-win32.phpt differ