X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=tests%2Funbuffered001.phpt;h=a009b632426be37d1d36b35adb579693fca957cd;hp=0754d8a767af4fb6802905de5946a147e1965b4b;hb=afc8bb8eb97946808833c55c60220fc661599574;hpb=3024b0b5a903a2bcb082b01e1787410dc9508a9d diff --git a/tests/unbuffered001.phpt b/tests/unbuffered001.phpt index 0754d8a..a009b63 100644 --- a/tests/unbuffered001.phpt +++ b/tests/unbuffered001.phpt @@ -26,22 +26,17 @@ $c->execAsync("SELECT a from generate_series(1,10) a", function($res) { break; } }); + do { while ($c->busy) { - switch ($c->poll()) { - case pq\Connection::POLLING_READING: - $w=$e=array(); - $r=array($c->socket); - stream:select($r,$w,$e,1); - break; - case pq\Connection::POLLING_WRITING: - $r=$e=array(); - $w=array($c->socket); - stream_select($r,$w,$e,1); - break; + $r = array($c->socket); + $w = $e = null; + if (stream_select($r, $w, $e, null)) { + $c->poll(); } } } while ($c->getResult()); + ?> DONE --EXPECTF--