diff --git a/ext/standard/tests/file/lstat_stat_variation1.phpt b/ext/standard/tests/file/lstat_stat_variation1.phpt new file mode 100755 index 00000000000..a2cfe8045e6 --- /dev/null +++ b/ext/standard/tests/file/lstat_stat_variation1.phpt @@ -0,0 +1,114 @@ +--TEST-- +Test lstat() and stat() functions: usage variations - effects of rename() +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- +*** Checking lstat() and stat() on file, link and directory ater renaming them *** +-- Testing stat() for files after being renamed -- +bool(true) +bool(true) +bool(true) +bool(true) +-- Testing stat() for directory after being renamed -- +bool(true) +bool(true) +bool(true) +bool(true) +-- Testing lstat() for link after being renamed -- +bool(true) +bool(true) +bool(true) +bool(true) + +--- Done --- diff --git a/ext/standard/tests/file/lstat_stat_variation2.phpt b/ext/standard/tests/file/lstat_stat_variation2.phpt new file mode 100755 index 00000000000..dea6e6de6c6 --- /dev/null +++ b/ext/standard/tests/file/lstat_stat_variation2.phpt @@ -0,0 +1,123 @@ +--TEST-- +Test lstat() and stat() functions: usage variations - effects of touch() +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- +*** Checking lstat() and stat() on file, link and directory after touching them *** +-- Testing stat() for file after using touch() on the file -- +bool(true) +bool(true) +bool(true) +bool(true) +-- Testing stat() for directory after using touch() on the directory -- +bool(true) +bool(true) +bool(true) +bool(true) +-- Testing lstat() for link after using touch() on the link -- +bool(true) +bool(true) +bool(true) +bool(true) + +--- Done --- diff --git a/ext/standard/tests/file/lstat_stat_variation3.phpt b/ext/standard/tests/file/lstat_stat_variation3.phpt new file mode 100755 index 00000000000..e523c0722d4 --- /dev/null +++ b/ext/standard/tests/file/lstat_stat_variation3.phpt @@ -0,0 +1,104 @@ +--TEST-- +Test lstat() and stat() functions: usage variations - effects with writing & creating/deleting file/subdir + +--SKIPIF-- + +--FILE-- +")); + +echo "\n--- Done ---"; +?> + +--CLEAN-- + +--EXPECTF-- +-- Testing stat() on file after data is written in it -- +bool(true) +bool(true) +bool(true) +-- Testing stat() on dir after subdir and file is created in it -- +bool(true) +bool(true) +bool(true) +-- Testing stat() for comparing stats after the deletion of subdir and file -- +bool(true) +bool(true) + +--- Done --- diff --git a/ext/standard/tests/file/lstat_stat_variation4.phpt b/ext/standard/tests/file/lstat_stat_variation4.phpt new file mode 100755 index 00000000000..1051c9f96d8 --- /dev/null +++ b/ext/standard/tests/file/lstat_stat_variation4.phpt @@ -0,0 +1,163 @@ +--TEST-- +Test lstat() and stat() functions: usage variations - effects of is_dir(), is_file() and is_link() + +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- +*** Checking lstat() and stat() on file, link and directory after accessing it + with is_dir(), is_file() and is_link() functions *** +-- Testing on Directory -- +bool(true) +bool(true) +bool(true) +bool(true) +-- Testing on file -- +bool(true) +bool(true) +bool(true) +bool(true) +-- Testing on link -- +bool(true) +bool(true) +bool(true) +bool(true) + +*** Checking stat() on a file with read/write permission *** +bool(true) +bool(true) +bool(true) + +*** Checking lstat() and stat() on hard link *** +bool(true) +bool(true) +bool(true) +bool(true) + +--- Done --- diff --git a/ext/standard/tests/file/lstat_stat_variation5.phpt b/ext/standard/tests/file/lstat_stat_variation5.phpt new file mode 100755 index 00000000000..0a6b446ae1d --- /dev/null +++ b/ext/standard/tests/file/lstat_stat_variation5.phpt @@ -0,0 +1,116 @@ +--TEST-- +Test lstat() and stat() functions: usage variations - effects with changing permissions +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- +*** Testing lstat() and stat() on links with miscelleneous file permission and content *** +bool(true) +bool(true) +bool(true) +bool(true) + +*** Testing lstat() and stat() on file with miscelleneous file permission and content *** +bool(true) +bool(true) +bool(true) +bool(true) + +*** Testing stat() on directory with miscelleneous file permission *** +bool(true) +bool(true) +bool(true) +bool(true) + +--- Done --- diff --git a/ext/standard/tests/file/lstat_stat_variation6.phpt b/ext/standard/tests/file/lstat_stat_variation6.phpt new file mode 100755 index 00000000000..ea3380b8a43 --- /dev/null +++ b/ext/standard/tests/file/lstat_stat_variation6.phpt @@ -0,0 +1,428 @@ +--TEST-- +Test lstat() and stat() functions: usage variations - dir/file/link names in objects + +--SKIPIF-- + +--FILE-- +var_name = $name; + } +} +// directory as member +$obj1 = new object_temp("$file_path/lstat_stat_variation6/"); +$obj2 = new object_temp("$file_path/lstat_stat_variation6a/"); + +// file as member +$obj3 = new object_temp("$file_path/lstat_stat_variation6.tmp"); +$obj4 = new object_temp("$file_path/lstat_stat_variation6a.tmp"); + +// link as member +$obj5 = new object_temp("$file_path/lstat_stat_variation6_link.tmp"); +$obj6 = new object_temp("$file_path/lstat_stat_variation6a_link.tmp"); + +echo "\n-- Testing lstat() and stat() with softlink, linkname stored inside an object --\n"; + +var_dump( lstat($obj5->var_name) ); + +var_dump( symlink($obj5->var_name, $obj6->var_name) ); +var_dump( lstat($obj6->var_name) ); + +echo "\n-- Testing stat() on filename stored inside an object --\n"; +var_dump( stat($obj3->var_name) ); + +$fp = fopen("$file_path/lstat_stat_variation6a.tmp", "w"); +fclose($fp); +var_dump( stat($obj4->var_name) ); + +echo "\n-- Testing stat() on directory name stored inside an object --\n"; +var_dump( stat($obj1->var_name) ); + +mkdir("$file_path/lstat_stat_variation6a/"); +var_dump( stat($obj2->var_name) ); + +echo "\n--- Done ---"; +?> + +--CLEAN-- + + +--EXPECTF-- +*** Testing lstat() and stat() with filename, linkname + and directory name stored inside a object *** + +-- Testing lstat() and stat() with softlink, linkname stored inside an object -- +array(26) { + [0]=> + int(%d) + [1]=> + int(%d) + [2]=> + int(%d) + [3]=> + int(%d) + [4]=> + int(%d) + [5]=> + int(%d) + [6]=> + int(%d) + [7]=> + int(%d) + [8]=> + int(%d) + [9]=> + int(%d) + [10]=> + int(%d) + [11]=> + int(%d) + [12]=> + int(%d) + ["dev"]=> + int(%d) + ["ino"]=> + int(%d) + ["mode"]=> + int(%d) + ["nlink"]=> + int(%d) + ["uid"]=> + int(%d) + ["gid"]=> + int(%d) + ["rdev"]=> + int(%d) + ["size"]=> + int(%d) + ["atime"]=> + int(%d) + ["mtime"]=> + int(%d) + ["ctime"]=> + int(%d) + ["blksize"]=> + int(%d) + ["blocks"]=> + int(%d) +} +bool(true) +array(26) { + [0]=> + int(%d) + [1]=> + int(%d) + [2]=> + int(%d) + [3]=> + int(%d) + [4]=> + int(%d) + [5]=> + int(%d) + [6]=> + int(%d) + [7]=> + int(%d) + [8]=> + int(%d) + [9]=> + int(%d) + [10]=> + int(%d) + [11]=> + int(%d) + [12]=> + int(%d) + ["dev"]=> + int(%d) + ["ino"]=> + int(%d) + ["mode"]=> + int(%d) + ["nlink"]=> + int(%d) + ["uid"]=> + int(%d) + ["gid"]=> + int(%d) + ["rdev"]=> + int(%d) + ["size"]=> + int(%d) + ["atime"]=> + int(%d) + ["mtime"]=> + int(%d) + ["ctime"]=> + int(%d) + ["blksize"]=> + int(%d) + ["blocks"]=> + int(%d) +} + +-- Testing stat() on filename stored inside an object -- +array(26) { + [0]=> + int(%d) + [1]=> + int(%d) + [2]=> + int(%d) + [3]=> + int(%d) + [4]=> + int(%d) + [5]=> + int(%d) + [6]=> + int(%d) + [7]=> + int(%d) + [8]=> + int(%d) + [9]=> + int(%d) + [10]=> + int(%d) + [11]=> + int(%d) + [12]=> + int(%d) + ["dev"]=> + int(%d) + ["ino"]=> + int(%d) + ["mode"]=> + int(%d) + ["nlink"]=> + int(%d) + ["uid"]=> + int(%d) + ["gid"]=> + int(%d) + ["rdev"]=> + int(%d) + ["size"]=> + int(%d) + ["atime"]=> + int(%d) + ["mtime"]=> + int(%d) + ["ctime"]=> + int(%d) + ["blksize"]=> + int(%d) + ["blocks"]=> + int(%d) +} +array(26) { + [0]=> + int(%d) + [1]=> + int(%d) + [2]=> + int(%d) + [3]=> + int(%d) + [4]=> + int(%d) + [5]=> + int(%d) + [6]=> + int(%d) + [7]=> + int(%d) + [8]=> + int(%d) + [9]=> + int(%d) + [10]=> + int(%d) + [11]=> + int(%d) + [12]=> + int(%d) + ["dev"]=> + int(%d) + ["ino"]=> + int(%d) + ["mode"]=> + int(%d) + ["nlink"]=> + int(%d) + ["uid"]=> + int(%d) + ["gid"]=> + int(%d) + ["rdev"]=> + int(%d) + ["size"]=> + int(%d) + ["atime"]=> + int(%d) + ["mtime"]=> + int(%d) + ["ctime"]=> + int(%d) + ["blksize"]=> + int(%d) + ["blocks"]=> + int(%d) +} + +-- Testing stat() on directory name stored inside an object -- +array(26) { + [0]=> + int(%d) + [1]=> + int(%d) + [2]=> + int(%d) + [3]=> + int(%d) + [4]=> + int(%d) + [5]=> + int(%d) + [6]=> + int(%d) + [7]=> + int(%d) + [8]=> + int(%d) + [9]=> + int(%d) + [10]=> + int(%d) + [11]=> + int(%d) + [12]=> + int(%d) + ["dev"]=> + int(%d) + ["ino"]=> + int(%d) + ["mode"]=> + int(%d) + ["nlink"]=> + int(%d) + ["uid"]=> + int(%d) + ["gid"]=> + int(%d) + ["rdev"]=> + int(%d) + ["size"]=> + int(%d) + ["atime"]=> + int(%d) + ["mtime"]=> + int(%d) + ["ctime"]=> + int(%d) + ["blksize"]=> + int(%d) + ["blocks"]=> + int(%d) +} +array(26) { + [0]=> + int(%d) + [1]=> + int(%d) + [2]=> + int(%d) + [3]=> + int(%d) + [4]=> + int(%d) + [5]=> + int(%d) + [6]=> + int(%d) + [7]=> + int(%d) + [8]=> + int(%d) + [9]=> + int(%d) + [10]=> + int(%d) + [11]=> + int(%d) + [12]=> + int(%d) + ["dev"]=> + int(%d) + ["ino"]=> + int(%d) + ["mode"]=> + int(%d) + ["nlink"]=> + int(%d) + ["uid"]=> + int(%d) + ["gid"]=> + int(%d) + ["rdev"]=> + int(%d) + ["size"]=> + int(%d) + ["atime"]=> + int(%d) + ["mtime"]=> + int(%d) + ["ctime"]=> + int(%d) + ["blksize"]=> + int(%d) + ["blocks"]=> + int(%d) +} + +--- Done ---