2014-11-14 03:01:07 +01:00
|
|
|
--TEST--
|
|
|
|
Check poll of a pipe works
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2019-04-29 07:40:20 +02:00
|
|
|
$php = (getenv('TEST_PHP_EXECUTABLE') ? : PHP_BINARY) . ' ' . (getenv('TEST_PHP_ARGS') ? : '-n');
|
|
|
|
$fd = popen($php . " ". __DIR__ . "/fixtures/proc.php 2>&1", "w");
|
2014-11-14 03:01:07 +01:00
|
|
|
stream_set_blocking($fd, 0);
|
|
|
|
|
|
|
|
$loop = uv_loop_new();
|
|
|
|
$poll = uv_poll_init($loop, $fd);
|
|
|
|
|
|
|
|
uv_poll_start($poll, UV::READABLE, function($poll, $stat, $ev, $fd) {
|
2014-11-14 03:26:36 +01:00
|
|
|
echo "\nOK";
|
2014-11-14 03:01:07 +01:00
|
|
|
uv_poll_stop($poll);
|
|
|
|
pclose($fd);
|
|
|
|
});
|
|
|
|
uv_run($loop);
|
|
|
|
--EXPECT--
|
2014-11-14 03:26:36 +01:00
|
|
|
hello
|
2014-11-14 03:01:07 +01:00
|
|
|
OK
|