Annotation of embedaddon/php/ext/standard/tests/streams/stream_get_meta_data_file_variation4.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: stream_get_meta_data() with a relative file path
3: --FILE--
4: <?php
5:
6: echo "Create a file:\n";
7: $filename = __FILE__ . '.tmp';
8: $fp = fopen('File://' . $filename, 'w+');
9:
10: var_dump(stream_get_meta_data($fp));
11:
12: fclose($fp);
13:
14: echo "\nChange to file's directory and open with a relative path:\n";
15:
16: $dirname = dirname($filename);
17: chdir($dirname);
18: $relative_filename = basename($filename);
19:
20: $fp = fopen($relative_filename, 'r');
21: var_dump(stream_get_meta_data($fp));
22:
23: fclose($fp);
24:
25: unlink($filename);
26:
27: ?>
28: --EXPECTF--
29: Create a file:
30: array(9) {
31: ["wrapper_type"]=>
32: string(9) "plainfile"
33: ["stream_type"]=>
34: string(5) "STDIO"
35: ["mode"]=>
36: string(2) "w+"
37: ["unread_bytes"]=>
38: int(0)
39: ["seekable"]=>
40: bool(true)
41: ["uri"]=>
42: string(%i) "File://%sstream_get_meta_data_file_variation4.php.tmp"
43: ["timed_out"]=>
44: bool(false)
45: ["blocked"]=>
46: bool(true)
47: ["eof"]=>
48: bool(false)
49: }
50:
51: Change to file's directory and open with a relative path:
52: array(9) {
53: ["wrapper_type"]=>
54: string(9) "plainfile"
55: ["stream_type"]=>
56: string(5) "STDIO"
57: ["mode"]=>
58: string(1) "r"
59: ["unread_bytes"]=>
60: int(0)
61: ["seekable"]=>
62: bool(true)
63: ["uri"]=>
64: string(%i) "stream_get_meta_data_file_variation4.php.tmp"
65: ["timed_out"]=>
66: bool(false)
67: ["blocked"]=>
68: bool(true)
69: ["eof"]=>
70: bool(false)
71: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>