From: Raghubansh Kumar Date: Thu, 5 Jul 2007 18:59:20 +0000 (+0000) Subject: fix test: 006_error.phpt & filegroup_basic.phpt X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~315 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c081bba9b0b7a3ba7c366b89ce0ebb94128ebd5;p=php fix test: 006_error.phpt & filegroup_basic.phpt fix and smaller tests for symlink_link_linkinfo_is_link[basic|error|variation].phpt --- diff --git a/ext/standard/tests/file/006_error.phpt b/ext/standard/tests/file/006_error.phpt index c1a4517b37..73fd139590 100644 --- a/ext/standard/tests/file/006_error.phpt +++ b/ext/standard/tests/file/006_error.phpt @@ -5,9 +5,17 @@ Test fileperms(), chmod() functions: error conditions if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip Not on Windows'); } -elseif (get_current_user() == 'root') { - die( "skip Do not run with root permissions" ); +// Skip if being run by root +$filename = dirname(__FILE__)."/006_root_check.tmp"; +$fp = fopen($filename, 'w'); +fclose($fp); +if(fileowner($filename) == 0) { + unlink ($filename); + die('skip...cannot be run as root\n'); } + +unlink($filename); + ?> --FILE-- --FILE-- @@ -17,7 +17,7 @@ echo "*** Testing filegroup(): basic functionality ***\n"; echo "-- Testing with the file or directory created by owner --\n"; $file_path = dirname(__FILE__); -var_dump( posix_getgrgid( filegroup(__FILE__) ) ); +var_dump( filegroup(__FILE__) ); var_dump( filegroup(".") ); var_dump( filegroup("./..") ); @@ -55,42 +55,22 @@ rmdir($dir_name); --EXPECTF-- *** Testing filegroup(): basic functionality *** -- Testing with the file or directory created by owner -- -array(4) { - ["name"]=> - string(%d) "%s" - ["passwd"]=> - string(1) "x" - ["members"]=> - array(0) { - } - ["gid"]=> - int(%d) -} +int(%d) int(%d) int(%d) int(%d) int(%d) -- Testing with the standard file or directory -- -int(0) -int(0) -int(0) +int(%d) +int(%d) +int(%d) *** Done *** --UEXPECTF-- *** Testing filegroup(): basic functionality *** -- Testing with the file or directory created by owner -- -array(4) { - ["name"]=> - string(%d) "%s" - ["passwd"]=> - string(1) "x" - ["members"]=> - array(0) { - } - ["gid"]=> - int(%d) -} +int(%d) int(%d) int(%d) @@ -99,8 +79,8 @@ int(%d) int(%d) -- Testing with the standard file or directory -- -int(0) -int(0) -int(0) +int(%d) +int(%d) +int(%d) *** Done *** diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic1.phpt new file mode 100644 index 0000000000..c3b6e61995 --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic1.phpt @@ -0,0 +1,137 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions: basic functionality - link to files +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing symlink(), linkinfo(), link() and is_link() : basic functionality *** + +-- Iteration 1 -- +-- Testing on soft links -- +bool(true) +int(%d) +bool(true) +-- Testing on hard links -- +bool(true) +int(%d) +bool(false) + +-- Iteration 2 -- +-- Testing on soft links -- +bool(true) +int(%d) +bool(true) +-- Testing on hard links -- +bool(true) +int(%d) +bool(false) +Done +--UEXPECTF-- +*** Testing symlink(), linkinfo(), link() and is_link() : basic functionality *** + +-- Iteration 1 -- +-- Testing on soft links -- +bool(true) +int(%d) +bool(true) +-- Testing on hard links -- +bool(true) +int(%d) +bool(false) + +-- Iteration 2 -- +-- Testing on soft links -- +bool(true) +int(%d) +bool(true) +-- Testing on hard links -- +bool(true) +int(%d) +bool(false) +Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic2.phpt new file mode 100644 index 0000000000..fa766c079e --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_basic2.phpt @@ -0,0 +1,110 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions: basic functionality - link to dirs +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing symlink(), linkinfo(), link() and is_link() : basic functionality *** + +*** Testing symlink(), linkinfo(), link() and is_link() on directory *** + +-- Testing on soft links -- +bool(true) +int(%d) +bool(true) + +-- Testing on hard links -- + +Warning: link(): %s in %s on line %d +bool(false) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) +bool(false) +Done +--UEXPECTF-- +*** Testing symlink(), linkinfo(), link() and is_link() : basic functionality *** + +*** Testing symlink(), linkinfo(), link() and is_link() on directory *** + +-- Testing on soft links -- +bool(true) +int(%d) +bool(true) + +-- Testing on hard links -- + +Warning: link(): %s in %s on line %d +bool(false) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) +bool(false) +Done \ No newline at end of file diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt new file mode 100644 index 0000000000..71ad685eaa --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt @@ -0,0 +1,158 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : error conditions - symlink & linkinfo +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing symlink() for error conditions *** + +Warning: symlink() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +Warning: symlink() expects exactly 2 parameters, 3 given in %s on line %d +NULL + +Warning: symlink(): %s in %s on line %d +bool(false) + +Warning: symlink(): %s in %s on line %d +bool(false) + +Warning: symlink(): %s in %s on line %d +bool(false) + +Warning: symlink(): No such file or directory in %s on line %d +bool(false) + +Warning: symlink(): No such file or directory in %s on line %d +bool(false) + +Warning: symlink(): No such file or directory in %s on line %d +bool(false) + +*** Testing linkinfo() for error conditions *** + +Warning: linkinfo() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: linkinfo() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) +Done +--UEXPECTF-- +*** Testing symlink() for error conditions *** + +Warning: symlink() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +Warning: symlink() expects exactly 2 parameters, 3 given in %s on line %d +NULL + +Warning: symlink(): %s in %s on line %d +bool(false) + +Warning: symlink(): %s in %s on line %d +bool(false) + +Warning: symlink(): %s in %s on line %d +bool(false) + +Warning: symlink(): No such file or directory in %s on line %d +bool(false) + +Warning: symlink(): No such file or directory in %s on line %d +bool(false) + +Warning: symlink(): No such file or directory in %s on line %d +bool(false) + +*** Testing linkinfo() for error conditions *** + +Warning: linkinfo() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: linkinfo() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) +Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt new file mode 100644 index 0000000000..9306ef7d68 --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error2.phpt @@ -0,0 +1,146 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : error conditions - link & is_link +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing link() for error conditions *** + +Warning: link() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +Warning: link() expects exactly 2 parameters, 3 given in %s on line %d +NULL + +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) + +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) + +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 *** + +Warning: is_link() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: is_link() expects exactly 1 parameter, 2 given in %s on line %d +NULL +bool(false) +bool(false) +bool(false) +bool(false) +Done +--UEXPECTF-- +*** Testing link() for error conditions *** + +Warning: link() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +Warning: link() expects exactly 2 parameters, 3 given in %s on line %d +NULL + +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) + +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) + +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 *** + +Warning: is_link() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: is_link() expects exactly 1 parameter, 2 given in %s on line %d +NULL +bool(false) +bool(false) +bool(false) +bool(false) +Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt new file mode 100644 index 0000000000..e32e4f41a9 --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt @@ -0,0 +1,161 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : usage variations - link name stored in an array/object +--SKIPIF-- + +--FILE-- +linkname = $link; + } +} + +$obj = new object_temp("$dirname/symlink_link_linkinfo_is_link_link.tmp"); +/* Testing on soft links */ +echo "\n-- Working with soft links --\n"; +// creating soft link +var_dump( symlink($filename, $obj->linkname) ); +// check if the link exists +var_dump( linkinfo($obj->linkname) ); +// check if link is soft link +var_dump( is_link($obj->linkname) ); +// delete the link created +unlink($obj->linkname); +// clear the cache +clearstatcache(); + +/* Testing on hard links */ +echo "\n-- Working with hard links --\n"; +// creating hard link +var_dump( link($filename, $obj->linkname) ); +// check if the link exists +var_dump( linkinfo($obj->linkname) ); +// check if link is soft link; expected: false as the link is a hardlink +var_dump( is_link($obj->linkname) ); +// delete the link created +unlink($obj->linkname); +// clear the cache +clearstatcache(); + +echo "\n*** Testing symlink(), link(), linkinfo() and is_link() with linknames stored as members of an array ***\n"; + +$link_arr = array("$dirname/symlink_link_linkinfo_is_link_link.tmp"); + +/* Testing on soft links */ +echo "\n-- Working with soft links --\n"; +// creating soft link +var_dump( symlink($filename, $link_arr[0]) ); +// check if the link exist +var_dump( linkinfo($link_arr[0]) ); +// check if link is soft link +var_dump( is_link($link_arr[0]) ); +// delete the link created +unlink($link_arr[0]); +// clear the cache +clearstatcache(); + +/* Testing on hard links */ +echo "\n-- Working with hard links --\n"; +// creating hard link +var_dump( link($filename, $link_arr[0]) ); +// check if the link exist +var_dump( linkinfo($link_arr[0]) ); +// check if link is soft link; expected: false as this is a hardlink +var_dump( is_link($link_arr[0]) ); +// delete the links created +unlink($link_arr[0]); +// clear the cache +clearstatcache(); + +echo "Done\n"; +?> +--CLEAN-- + +--EXPECTF-- +*** Testing symlink(), link(), linkinfo() and is_link() with linknames stored as members in an object *** + +-- Working with soft links -- +bool(true) +int(%d) +bool(true) + +-- Working with hard links -- +bool(true) +int(%d) +bool(false) + +*** Testing symlink(), link(), linkinfo() and is_link() with linknames stored as members of an array *** + +-- Working with soft links -- +bool(true) +int(%d) +bool(true) + +-- Working with hard links -- +bool(true) +int(%d) +bool(false) +Done +--UEXPECTF-- +*** Testing symlink(), link(), linkinfo() and is_link() with linknames stored as members in an object *** + +-- Working with soft links -- +bool(true) +int(%d) +bool(true) + +-- Working with hard links -- +bool(true) +int(%d) +bool(false) + +*** Testing symlink(), link(), linkinfo() and is_link() with linknames stored as members of an array *** + +-- Working with soft links -- +bool(true) +int(%d) +bool(true) + +-- Working with hard links -- +bool(true) +int(%d) +bool(false) +Done \ No newline at end of file diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation2.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation2.phpt new file mode 100644 index 0000000000..68cdaaa4f5 --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation2.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : usage variations - hardlink to non-existent file +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Creating a hard link to a non-existent file *** + +Warning: link(): No such file or directory in %s on line %d +bool(false) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) +bool(false) +Done +--UEXPECTF-- +*** Creating a hard link to a non-existent file *** + +Warning: link(): No such file or directory in %s on line %d +bool(false) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) +bool(false) +Done \ No newline at end of file diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation3.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation3.phpt new file mode 100644 index 0000000000..d0e3dad2c0 --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation3.phpt @@ -0,0 +1,177 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : usage variations - access/update file through softlink +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Accessing and updating data of file through soft link *** +bool(true) + +-- Access data of the file through the soft link -- +string(80) "texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext" + +-- Check size of soft link and file -- +int(80) +int(80) + +Soft link size remains same + +-- Updating file with data through soft link -- +string(91) "texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttextHello World" + +-- Check size of soft link and file -- +int(91) +int(91) + +Soft link size remains same + +-- Updating file with data and check data through soft link -- +string(11) "Hello World" + +-- Check size of soft link and file -- +int(11) +int(11) + +Soft link size remains same +Done +--UEXPECTF-- +*** Accessing and updating data of file through soft link *** +bool(true) + +-- Access data of the file through the soft link -- +string(80) "texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext" + +-- Check size of soft link and file -- +int(80) +int(80) + +Soft link size remains same + +-- Updating file with data through soft link -- +string(91) "texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttextHello World" + +-- Check size of soft link and file -- +int(91) +int(91) + +Soft link size remains same + +-- Updating file with data and check data through soft link -- +string(11) "Hello World" + +-- Check size of soft link and file -- +int(11) +int(11) + +Soft link size remains same +Done \ No newline at end of file diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation4.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation4.phpt new file mode 100644 index 0000000000..a544249177 --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation4.phpt @@ -0,0 +1,147 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : usage variations - access/update file through hard link +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Accessing and updating data of file through hard link *** + +-- Access data of the file through the hard link -- +bool(true) +string(80) "texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext" + +-- Check size of hard link and file -- + +Size of file and hard link are same + +-- Updating file with data through hard link -- +string(91) "texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttextHello World" + +-- Check size of hard link and file -- + +Size of file and hard link are same + +-- Updating file with data and check data through hard link -- +string(11) "Hello World" + +-- Check size of hard link and file -- +int(11) +int(11) + +Size of file and hard link are same +Done +--UEXPECTF-- +*** Accessing and updating data of file through hard link *** + +-- Access data of the file through the hard link -- +bool(true) +string(80) "texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttext" + +-- Check size of hard link and file -- + +Size of file and hard link are same + +-- Updating file with data through hard link -- +string(91) "texttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttexttextHello World" + +-- Check size of hard link and file -- + +Size of file and hard link are same + +-- Updating file with data and check data through hard link -- +string(11) "Hello World" + +-- Check size of hard link and file -- +int(11) +int(11) + +Size of file and hard link are same +Done \ No newline at end of file diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation5.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation5.phpt new file mode 100644 index 0000000000..cfc94262f2 --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation5.phpt @@ -0,0 +1,84 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : usage variations - work on deleted link +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Testing linkinfo() and is_link() on deleted link *** +bool(true) +bool(true) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) +bool(false) +Done +--UEXPECTF-- +*** Testing linkinfo() and is_link() on deleted link *** +bool(true) +bool(true) + +Warning: linkinfo(): No such file or directory in %s on line %d +int(-1) +bool(false) +Done \ No newline at end of file diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation6.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation6.phpt new file mode 100644 index 0000000000..ea50d302eb --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation6.phpt @@ -0,0 +1,111 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : usage variations - link & dir perms. +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Creating links in a directory without permission to allow the operation *** +bool(true) + +-- Working with soft links -- + +Warning: symlink(): Permission denied in %s on line %d +bool(false) + +Warning: linkinfo(): Permission denied in %s on line %d +int(-1) +bool(false) + +-- Working with hard links -- + +Warning: link(): Permission denied in %s on line %d +bool(false) + +Warning: linkinfo(): Permission denied in %s on line %d +int(-1) +bool(false) +Done +--UEXPECTF-- +*** Creating links in a directory without permission to allow the operation *** +bool(true) + +-- Working with soft links -- + +Warning: symlink(): Permission denied in %s on line %d +bool(false) + +Warning: linkinfo(): Permission denied in %s on line %d +int(-1) +bool(false) + +-- Working with hard links -- + +Warning: link(): Permission denied in %s on line %d +bool(false) + +Warning: linkinfo(): Permission denied in %s on line %d +int(-1) +bool(false) +Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation7.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation7.phpt new file mode 100644 index 0000000000..44188080fe --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation7.phpt @@ -0,0 +1,113 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : usage variations - try link to self +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Create soft link to file and then to itself *** +bool(true) + +Warning: symlink(): File exists in %s on line %d +bool(false) + +*** Create soft link to directory and then to itself *** +bool(true) + +Warning: symlink(): File exists in %s on line %d +bool(false) + +*** Create hard link to file and then to itself *** +bool(true) + +Warning: link(): File exists in %s on line %d +bool(false) +Done +--UEXPECTF-- +*** Create soft link to file and then to itself *** +bool(true) + +Warning: symlink(): File exists in %s on line %d +bool(false) + +*** Create soft link to directory and then to itself *** +bool(true) + +Warning: symlink(): File exists in %s on line %d +bool(false) + +*** Create hard link to file and then to itself *** +bool(true) + +Warning: link(): File exists in %s on line %d +bool(false) +Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation8.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation8.phpt new file mode 100644 index 0000000000..81906bf69b --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation8.phpt @@ -0,0 +1,96 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : usage variations - try link with same name in diff. dir +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +*** Create hard link in different directory with same filename *** + +Warning: link(): File exists in %s on line %d +bool(false) +bool(true) + +*** Create soft link in different directory with same filename *** + +Warning: symlink(): File exists in %s on line %d +bool(false) +bool(true) +Done +--UEXPECTF-- +*** Create hard link in different directory with same filename *** + +Warning: link(): File exists in %s on line %d +bool(false) +bool(true) + +*** Create soft link in different directory with same filename *** + +Warning: symlink(): File exists in %s on line %d +bool(false) +bool(true) +Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation9.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation9.phpt new file mode 100644 index 0000000000..71dfb801e1 --- /dev/null +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation9.phpt @@ -0,0 +1,143 @@ +--TEST-- +Test symlink(), linkinfo(), link() and is_link() functions : usage variations - link & lstat[dev] value +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECTF-- +*** Checking lstat() on soft link *** +bool(true) +linkinfo() returns : %d +lstat() returns lstat['dev'] as %d + +linkinfo() value matches lstat['dev'] + +*** Checking lstat() on hard link *** +bool(true) +linkinfo() returns : %d +lstat() returns lstat['dev'] as %d + +linkinfo() value matches lstat['dev'] + +*** Checking lstat() on a soft link to directory *** +bool(true) +linkinfo() returns : %d +lstat() returns lstat['dev'] as %d + +linkinfo() value matches lstat['dev'] +Done +--UEXPECTF-- +*** Checking lstat() on soft link *** +bool(true) +linkinfo() returns : %d +lstat() returns lstat['dev'] as %d + +linkinfo() value matches lstat['dev'] + +*** Checking lstat() on hard link *** +bool(true) +linkinfo() returns : %d +lstat() returns lstat['dev'] as %d + +linkinfo() value matches lstat['dev'] + +*** Checking lstat() on a soft link to directory *** +bool(true) +linkinfo() returns : %d +lstat() returns lstat['dev'] as %d + +linkinfo() value matches lstat['dev'] +Done \ No newline at end of file