X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=tests%2Funbuffered001.phpt;h=46e4b9b551e48a3ab70a6691dcc6c4b73304a3ba;hp=0754d8a767af4fb6802905de5946a147e1965b4b;hb=9d64e781a870ed359d744b4c2dbba4c6c11c44f1;hpb=3024b0b5a903a2bcb082b01e1787410dc9508a9d diff --git a/tests/unbuffered001.phpt b/tests/unbuffered001.phpt index 0754d8a..46e4b9b 100644 --- a/tests/unbuffered001.phpt +++ b/tests/unbuffered001.phpt @@ -1,7 +1,11 @@ --TEST-- unbuffered result --SKIPIF-- - + --FILE-- unbuffered); $c->execAsync("SELECT a from generate_series(1,10) a", function($res) { switch ($res->status) { case pq\Result::SINGLE_TUPLE: - printf("%s\n", $res->fetchCol()); + $res->fetchCol($val, "a"); + printf("%s\n", $val); break; case pq\Result::TUPLES_OK: printf("-> fetching done\n"); @@ -26,22 +31,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--