test to function stream_socket_get_name();

This commit is contained in:
marcosptf 2015-12-14 14:17:47 -02:00 committed by Julien Pauli
parent 3295264336
commit a7daf97198

View 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)