From: Raghubansh Kumar Date: Sun, 22 Jul 2007 12:37:09 +0000 (+0000) Subject: New testcases for stat() function on windows X-Git-Tag: php-5.2.4RC1~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6278717f5afe56c66c5d0b2680da3ab7c5b87ef;p=php New testcases for stat() function on windows --- diff --git a/ext/standard/tests/file/stat_variation1-win32.phpt b/ext/standard/tests/file/stat_variation1-win32.phpt new file mode 100644 index 0000000000..f8a8e95c5e --- /dev/null +++ b/ext/standard/tests/file/stat_variation1-win32.phpt @@ -0,0 +1,93 @@ +--TEST-- +Test stat() functions: usage variations - effects of rename() +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- +*** Testing stat(): on file 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) + +*** Done *** diff --git a/ext/standard/tests/file/stat_variation2-win32.phpt b/ext/standard/tests/file/stat_variation2-win32.phpt new file mode 100644 index 0000000000..021596f4db --- /dev/null +++ b/ext/standard/tests/file/stat_variation2-win32.phpt @@ -0,0 +1,64 @@ +--TEST-- +Test stat() functions: usage variations - effects of writing to file +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- +*** Testing stat(): writing to a file *** +-- Testing stat() on file after data is written in it -- +bool(true) +bool(true) +bool(true) + +*** Done *** diff --git a/ext/standard/tests/file/stat_variation3-win32.phpt b/ext/standard/tests/file/stat_variation3-win32.phpt new file mode 100644 index 0000000000..4269aa49a3 --- /dev/null +++ b/ext/standard/tests/file/stat_variation3-win32.phpt @@ -0,0 +1,78 @@ +--TEST-- +Test stat() functions: usage variations - effects of creating/deleting the dir/file +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- + +*** Testing stat(): with creating & deleting subdir/file *** +-- 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 \ No newline at end of file diff --git a/ext/standard/tests/file/stat_variation4-win32.phpt b/ext/standard/tests/file/stat_variation4-win32.phpt new file mode 100644 index 0000000000..55916852ac --- /dev/null +++ b/ext/standard/tests/file/stat_variation4-win32.phpt @@ -0,0 +1,91 @@ +--TEST-- +Test stat() functions: usage variations - effects of is_dir() & is_file() +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- +*** Testing stat(): on file and directory after accessing it + with is_dir() and is_file() functions *** +-- Testing on Directory -- +bool(true) +bool(true) +bool(true) +bool(true) +-- Testing on file -- +bool(true) +bool(true) +bool(true) +bool(true) +Done diff --git a/ext/standard/tests/file/stat_variation5-win32.phpt b/ext/standard/tests/file/stat_variation5-win32.phpt new file mode 100644 index 0000000000..8de45b6331 --- /dev/null +++ b/ext/standard/tests/file/stat_variation5-win32.phpt @@ -0,0 +1,64 @@ +--TEST-- +Test stat() functions: usage variations - file opened in read/write mode +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- + +*** Testing stat(): on a file with read/write permission *** +bool(true) +bool(true) +bool(true) +Done diff --git a/ext/standard/tests/file/stat_variation6-win32.phpt b/ext/standard/tests/file/stat_variation6-win32.phpt new file mode 100644 index 0000000000..18b87f7af6 --- /dev/null +++ b/ext/standard/tests/file/stat_variation6-win32.phpt @@ -0,0 +1,90 @@ +--TEST-- +Test stat() functions: usage variations - changing permissions of dir/file +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- + +*** Testing 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/stat_variation7-win32.phpt b/ext/standard/tests/file/stat_variation7-win32.phpt new file mode 100644 index 0000000000..a96a72ba5b --- /dev/null +++ b/ext/standard/tests/file/stat_variation7-win32.phpt @@ -0,0 +1,297 @@ +--TEST-- +Test stat() functions: usage variations - names of dir/file stored in objects +--SKIPIF-- + +--FILE-- +var_name = $name; + } +} + +// directory as member +$obj1 = new object_temp("$file_path/stat_variation7/"); +$obj2 = new object_temp("$file_path/stat_variation7a/"); + +// file as member +$obj3 = new object_temp("$file_path/stat_variation7.tmp"); +$obj4 = new object_temp("$file_path/stat_variation7a.tmp"); + +echo "\n-- Testing stat() on filename stored inside an object --\n"; +var_dump( stat($obj3->var_name) ); + +$file_handle = fopen("$file_path/stat_variation7a.tmp", "w"); +fclose($file_handle); +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/stat_variation7a/"); +var_dump( stat($obj2->var_name) ); + +echo "\n*** Done ***"; +?> + +--CLEAN-- + +--EXPECTF-- +*** Testing stat(): with filename + and directory name stored inside a object *** + +-- 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 *** diff --git a/ext/standard/tests/file/stat_variation8-win32.phpt b/ext/standard/tests/file/stat_variation8-win32.phpt new file mode 100644 index 0000000000..e682f2dab6 --- /dev/null +++ b/ext/standard/tests/file/stat_variation8-win32.phpt @@ -0,0 +1,75 @@ +--TEST-- +Test stat() functions: usage variations - effects of truncate() +--SKIPIF-- + +--FILE-- + + +--CLEAN-- + +--EXPECTF-- +*** Testing stat(): on file by truncating it to given size *** +bool(true) +bool(true) +bool(true) +bool(true) +Done