mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
test to function stream_socket_get_name();
This commit is contained in:
parent
3295264336
commit
a7daf97198
26
ext/standard/tests/streams/stream_socket_get_name.phpt
Normal file
26
ext/standard/tests/streams/stream_socket_get_name.phpt
Normal file
@ -0,0 +1,26 @@
|
||||
--TEST--
|
||||
string stream_socket_get_name ( resource $handle , bool $want_peer ) ;
|
||||
--CREDITS--
|
||||
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (phpversion() < "5.3.0") {
|
||||
die('SKIP php version so lower.');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$serverUri = "tcp://127.0.0.1:31854";
|
||||
$sock = stream_socket_server($serverUri, $errno, $errstr);
|
||||
|
||||
var_dump(stream_socket_get_name($sock, false));
|
||||
var_dump(stream_socket_get_name($sock, true));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
unset($serverUri);
|
||||
unset($sock);
|
||||
?>
|
||||
--EXPECT--
|
||||
string(15) "127.0.0.1:31854"
|
||||
bool(false)
|
Loading…
Reference in New Issue
Block a user