]> granicus.if.org Git - php/commitdiff
Revert to the previous version for these tests as they were overwritten by mistake...
authorAnt Phillips <ant@php.net>
Wed, 31 Dec 2008 10:36:13 +0000 (10:36 +0000)
committerAnt Phillips <ant@php.net>
Wed, 31 Dec 2008 10:36:13 +0000 (10:36 +0000)
ext/standard/tests/file/fread_error.phpt
ext/standard/tests/file/lstat_stat_variation2.phpt
ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt

index ae45f5e274cd3d14bf31f2f2627c5173c717d80b..582c2c5401a5fe493e797b9bc032b9c902228bbd 100644 (file)
@@ -103,7 +103,7 @@ NULL
 
 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() expects parameter 1 to be resource, null given in %s on line %d
index 73ab385120098ed3b62c5c34d4081f50609effad..e7d704a20b3a98855de00aee52bf30f86958ec00 100755 (executable)
@@ -21,13 +21,12 @@ $file_path = dirname(__FILE__);
 require("file.inc");
 
 /* create temp directory */
-@rmdir("$file_path/lstat_stat_variation2/");  //ensure that dir doesn't exists 
-mkdir("$file_path/lstat_stat_variation2/");  // temp dir
+mkdir("$file_path/lstat_stat_variation1/");  // temp dir
 
 // renaming a directory and check stat
 echo "*** Testing stat() for directory after being renamed ***\n";
-$old_dirname = "$file_path/lstat_stat_variation2";
-$new_dirname = "$file_path/lstat_stat_variation2a";
+$old_dirname = "$file_path/lstat_stat_variation1";
+$new_dirname = "$file_path/lstat_stat_variation1a";
 $old_stat = stat($old_dirname);
 clearstatcache();
 var_dump( rename($old_dirname, $new_dirname) );
@@ -37,8 +36,11 @@ $new_stat = stat($new_dirname);
 var_dump( compare_self_stat($old_stat) );
 var_dump( compare_self_stat($new_stat) );
 
-// compare the two stats
-var_dump( compare_stats($old_stat, $new_stat, $all_stat_keys) );
+// compare the two stats - all except ctime
+$keys_to_compare = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 
+                       "dev", "ino", "mode", "nlink", "uid", "gid",
+                       "rdev", "size", "atime", "mtime", "blksize", "blocks");
+var_dump( compare_stats($old_stat, $new_stat, $keys_to_compare) );
 // clear the cache
 clearstatcache();
 
@@ -48,9 +50,9 @@ echo "\n--- Done ---";
 --CLEAN--
 <?php
 $file_path = dirname(__FILE__);
-rmdir("$file_path/lstat_stat_variation2a");
+rmdir("$file_path/lstat_stat_variation1a");
 ?>
---EXPECT--
+--EXPECTF--
 *** Testing stat() for directory after being renamed ***
 bool(true)
 bool(true)
index 3bee688d87f13cb99d7ce5d69e1a449577de5038..98ce6211dad8f8ac6ad6d38c7a41175376457650 100644 (file)
@@ -5,7 +5,7 @@ Test symlink(), linkinfo(), link() and is_link() functions : error conditions -
 if (substr(PHP_OS, 0, 3) == 'WIN') {
     die('skip no symlinks on Windows');
 }
-if (PHP_INT_SIZE != 4 ) {
+if (PHP_INT_SIZE != 4) {
   die("skip this test is for 32bit platform only");
 }
 ?>
@@ -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
 
@@ -75,22 +77,25 @@ NULL
 Warning: link() expects exactly 2 parameters, 3 given in %s on line %d
 NULL
 
-Warning: link(): %s in %s on line %d
+Warning: link(): No such file or directory in %s on line %d
 bool(false)
 
-Warning: link(): %s in %s on line %d
+Warning: link(): No such file or directory in %s on line %d
 bool(false)
 
-Warning: link(): %s in %s on line %d
+Warning: link(): No such file or directory in %s on line %d
 bool(false)
 
-Warning: link(): %s in %s on line %d
+Warning: link(): No such file or directory in %s on line %d
 bool(false)
 
-Warning: link(): %s in %s on line %d
+Warning: link(): No such file or directory in %s on line %d
 bool(false)
 
-Warning: link(): %s in %s on line %d
+Warning: link(): No such file or directory in %s on line %d
+bool(false)
+
+Warning: link(): No such file or directory in %s on line %d
 bool(false)
 
 *** Testing is_link() for error conditions ***
@@ -104,4 +109,6 @@ bool(false)
 bool(false)
 bool(false)
 bool(false)
+bool(false)
 Done
+