Annotation of embedaddon/php/ext/standard/tests/file/filegroup_variation1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test filegroup() function: usage variations - links
3: --CREDITS--
4: Dave Kelsey <d_kelsey@uk.ibm.com>
5: --SKIPIF--
6: <?php
7: if (substr(PHP_OS, 0, 3) == 'WIN') {
8: die('skip Do not run on Windows');
9: }
10: --FILE--
11: <?php
12: /* Prototype: int filegroup ( string $filename )
13: * Description: Returns the group ID of the file, or FALSE in case of an error.
14: */
15:
16: /* Creating soft and hard links to a file and applying filegroup() on links */
17:
18: $file_path = dirname(__FILE__);
19: fclose( fopen($file_path."/filegroup_variation1.tmp", "w") );
20:
21: echo "*** Testing filegroup() with links ***\n";
22: /* With symlink */
23: symlink($file_path."/filegroup_variation1.tmp", $file_path."/filegroup_variation1_symlink.tmp");
24: var_dump( filegroup($file_path."/filegroup_variation1_symlink.tmp") ); //expected true
25: clearstatcache();
26:
27: /* With hardlink */
28: link($file_path."/filegroup_variation1.tmp", $file_path."/filegroup_variation1_link.tmp");
29: var_dump( filegroup($file_path."/filegroup_variation1_link.tmp") ); // expected: true
30: clearstatcache();
31:
32: echo "\n*** Done ***";
33: ?>
34: --CLEAN--
35: <?php
36: $file_path = dirname(__FILE__);
37: unlink($file_path."/filegroup_variation1_symlink.tmp");
38: unlink($file_path."/filegroup_variation1_link.tmp");
39: unlink($file_path."/filegroup_variation1.tmp");
40: ?>
41:
42: --EXPECTF--
43: *** Testing filegroup() with links ***
44: int(%d)
45: int(%d)
46:
47: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>