xref: /php-uv/tests/330-poll-pipe.phpt (revision a4c0fc2e)
1--TEST--
2Check poll of a pipe works
3--FILE--
4<?php
5$php = (getenv('TEST_PHP_EXECUTABLE') ? : PHP_BINARY)  . ' ' . (getenv('TEST_PHP_ARGS') ? : '-n');
6$fd = popen($php . " ". __DIR__ . "/fixtures/proc.php 2>&1", "w");
7stream_set_blocking($fd, 0);
8
9$loop = uv_loop_new();
10$poll = uv_poll_init($loop, $fd);
11
12uv_poll_start($poll, UV::READABLE, function($poll, $stat, $ev, $fd) {
13    echo "\nOK";
14    uv_poll_stop($poll);
15    pclose($fd);
16});
17uv_run($loop);
18--EXPECT--
19hello
20OK
21