Annotation of embedaddon/php/ext/standard/tests/file/userstreams_007.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: User-space streams: test metadata option
! 3: --FILE--
! 4: <?php
! 5: class 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:
! 21: var_dump(stream_wrapper_register('test', 'test_wrapper'));
! 22:
! 23: $fd = fopen("test://foo","r");
! 24: touch("test://testdir/touch");
! 25: touch("test://testdir/touch", 1);
! 26: touch("test://testdir/touch", 1, 2);
! 27: chown("test://testdir/chown", "test");
! 28: chown("test://testdir/chown", 42);
! 29: chgrp("test://testdir/chgrp", "test");
! 30: chgrp("test://testdir/chgrp", 42);
! 31: chmod("test://testdir/chmod", 0755);
! 32: --EXPECT--
! 33: bool(true)
! 34: metadata: test://testdir/touch, 1
! 35:
! 36: metadata: test://testdir/touch, 1
! 37: 1,1
! 38: metadata: test://testdir/touch, 1
! 39: 1,2
! 40: metadata: test://testdir/chown, 2
! 41: test
! 42: metadata: test://testdir/chown, 3
! 43: 42
! 44: metadata: test://testdir/chgrp, 4
! 45: test
! 46: metadata: test://testdir/chgrp, 5
! 47: 42
! 48: metadata: test://testdir/chmod, 6
! 49: 493
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>