1--TEST--
2User-space streams: test metadata option
3--FILE--
4<?php
5class test_wrapper {
6	function stream_open($path, $mode, $openedpath) {
7		return true;
8	}
9    public function stream_metadata($path, $option, $var) {
10		echo "metadata: $path, $option\n";
11		if(is_array($var)) {
12			echo join(",", $var);
13		} else {
14			echo $var;
15		}
16		echo "\n";
17		return false;
18	}
19}
20
21var_dump(stream_wrapper_register('test', 'test_wrapper'));
22
23$fd = fopen("test://foo","r");
24touch("test://testdir/touch");
25touch("test://testdir/touch", 1);
26touch("test://testdir/touch", 1, 2);
27chown("test://testdir/chown", "test");
28chown("test://testdir/chown", 42);
29chgrp("test://testdir/chgrp", "test");
30chgrp("test://testdir/chgrp", 42);
31chmod("test://testdir/chmod", 0755);
32--EXPECT--
33bool(true)
34metadata: test://testdir/touch, 1
35
36metadata: test://testdir/touch, 1
371,1
38metadata: test://testdir/touch, 1
391,2
40metadata: test://testdir/chown, 2
41test
42metadata: test://testdir/chown, 3
4342
44metadata: test://testdir/chgrp, 4
45test
46metadata: test://testdir/chgrp, 5
4742
48metadata: test://testdir/chmod, 6
49493
50