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