Annotation of embedaddon/php/ext/standard/tests/file/stream_supports_lock.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: stream_supports_lock
! 3: --INI--
! 4: allow_url_fopen=1
! 5: --FILE--
! 6: <?php
! 7: $fp = fopen(__FILE__, "r");
! 8: var_dump($fp);
! 9: var_dump(stream_supports_lock($fp));
! 10: fclose($fp);
! 11:
! 12: $fp = fopen("file://" . __FILE__, "r");
! 13: var_dump($fp);
! 14: var_dump(stream_supports_lock($fp));
! 15: fclose($fp);
! 16:
! 17: $fp = fopen("php://memory", "r");
! 18: var_dump($fp);
! 19: var_dump(stream_supports_lock($fp));
! 20: fclose($fp);
! 21:
! 22: $fp = fopen('data://text/plain,foobar', 'r');
! 23: var_dump($fp);
! 24: var_dump(stream_supports_lock($fp));
! 25: fclose($fp);
! 26:
! 27: $sock = stream_context_create();
! 28: var_dump($sock);
! 29: var_dump(stream_supports_lock($sock));
! 30:
! 31: echo "Done\n";
! 32: ?>
! 33: --EXPECTF--
! 34: resource(%d) of type (stream)
! 35: bool(true)
! 36: resource(%d) of type (stream)
! 37: bool(true)
! 38: resource(%d) of type (stream)
! 39: bool(false)
! 40: resource(%d) of type (stream)
! 41: bool(false)
! 42: resource(%d) of type (stream-context)
! 43:
! 44: Warning: stream_supports_lock(): supplied resource is not a valid stream resource in %s on line %d
! 45: bool(false)
! 46: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>