mirror of
https://github.com/php/php-src.git
synced 2024-09-26 20:37:29 +00:00
9c1e1bbc05
While running these on HHVM I've run into a lot of parallelism issues. I'm backporting all the fixes I had to do in https://github.com/facebook/hiphop-php/blob/master/hphp/tools/import_zend_test.py#L650 to php core. Most of these changes were just filenames that were shared between tests, but I did more surgery on the fixed ports. I can apreciate port 31337 as much as the next nerd, but random ports are better for tests.
36 lines
543 B
PHP
36 lines
543 B
PHP
--TEST--
|
|
Testing socket_get_status()
|
|
--FILE--
|
|
<?php
|
|
|
|
for ($i=0; $i<100; $i++) {
|
|
$port = rand(10000, 65000);
|
|
/* Setup socket server */
|
|
$server = @stream_socket_server("tcp://127.0.0.1:$port");
|
|
if ($server) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
var_dump(socket_get_status($server));
|
|
fclose($server);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
array(7) {
|
|
["stream_type"]=>
|
|
string(%d) "tcp_socket%S"
|
|
["mode"]=>
|
|
string(2) "r+"
|
|
["unread_bytes"]=>
|
|
int(0)
|
|
["seekable"]=>
|
|
bool(false)
|
|
["timed_out"]=>
|
|
bool(false)
|
|
["blocked"]=>
|
|
bool(true)
|
|
["eof"]=>
|
|
bool(false)
|
|
}
|