Annotation of embedaddon/php/ext/standard/tests/file/filegroup_variation3.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test filegroup() function: usage variations - diff. path notations
! 3: --CREDITS--
! 4: Dave Kelsey <d_kelsey@uk.ibm.com>
! 5: --FILE--
! 6: <?php
! 7: /* Prototype: int filegroup ( string $filename )
! 8: * Description: Returns the group ID of the file, or FALSE in case of an error.
! 9: */
! 10:
! 11: /* Passing file names with different notations, using slashes, wild-card chars */
! 12:
! 13: $file_path = dirname(__FILE__);
! 14:
! 15: echo "*** Testing filegroup() with different notations of file names ***\n";
! 16: $dir_name = $file_path."/filegroup_variation3";
! 17: mkdir($dir_name);
! 18: $file_handle = fopen($dir_name."/filegroup_variation3.tmp", "w");
! 19: fclose($file_handle);
! 20:
! 21: $files_arr = array(
! 22: "/filegroup_variation3/filegroup_variation3.tmp",
! 23:
! 24: /* Testing a file trailing slash */
! 25: "/filegroup_variation3/filegroup_variation3.tmp/",
! 26:
! 27: /* Testing file with double slashes */
! 28: "/filegroup_variation3//filegroup_variation3.tmp",
! 29: "//filegroup_variation3//filegroup_variation3.tmp",
! 30: "/filegroup_variation3/*.tmp",
! 31: "filegroup_variation3/filegroup*.tmp",
! 32:
! 33: /* Testing Binary safe */
! 34: "/filegroup_variation3/filegroup_variation3.tmp".chr(0),
! 35: "/filegroup_variation3/filegroup_variation3.tmp\0"
! 36: );
! 37:
! 38: $count = 1;
! 39: /* loop through to test each element in the above array */
! 40: foreach($files_arr as $file) {
! 41: echo "- Iteration $count -\n";
! 42: var_dump( filegroup( $file_path."/".$file ) );
! 43: clearstatcache();
! 44: $count++;
! 45: }
! 46:
! 47: echo "\n*** Done ***";
! 48: ?>
! 49: --CLEAN--
! 50: <?php
! 51: $file_path = dirname(__FILE__);
! 52: $dir_name = $file_path."/filegroup_variation3";
! 53: unlink($dir_name."/filegroup_variation3.tmp");
! 54: rmdir($dir_name);
! 55: ?>
! 56: --EXPECTF--
! 57: *** Testing filegroup() with different notations of file names ***
! 58: - Iteration 1 -
! 59: int(%d)
! 60: - Iteration 2 -
! 61:
! 62: Warning: filegroup(): stat failed for %s//filegroup_variation3/filegroup_variation3.tmp/ in %s on line %d
! 63: bool(false)
! 64: - Iteration 3 -
! 65: int(%d)
! 66: - Iteration 4 -
! 67: int(%d)
! 68: - Iteration 5 -
! 69:
! 70: Warning: filegroup(): stat failed for %s//filegroup_variation3/*.tmp in %s on line %d
! 71: bool(false)
! 72: - Iteration 6 -
! 73:
! 74: Warning: filegroup(): stat failed for %s/filegroup_variation3/filegroup*.tmp in %s on line %d
! 75: bool(false)
! 76: - Iteration 7 -
! 77: bool(false)
! 78: - Iteration 8 -
! 79: bool(false)
! 80:
! 81: *** Done ***
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>