X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fasync006.phpt;fp=tests%2Fasync006.phpt;h=81ee66e40d013dad5d7b6cd67a3c7ae3c8a3b252;hb=53220e4b7f293ed8c1c8418efc98c57d4b205e1d;hp=0000000000000000000000000000000000000000;hpb=8c92aa4bd855482cc76117129e16b42c7ecc57f0;p=m6w6%2Fext-pq diff --git a/tests/async006.phpt b/tests/async006.phpt new file mode 100644 index 0000000..81ee66e --- /dev/null +++ b/tests/async006.phpt @@ -0,0 +1,86 @@ +--TEST-- +async unbuffered exec +--SKIPIF-- + +--FILE-- +unbuffered = true; +$c->execAsync("SELECT a FROM generate_series(1,3) a", function ($res) { + var_dump($res); +}); +do { + while ($c->busy) { + $r = array($c->socket); + $w = $e = null; + if (stream_select($r, $w, $e, null)) { + $c->poll(); + } + } +} while ($c->getResult()); + +?> +DONE +--EXPECTF-- +Test +object(pq\Result)#%d (6) { + ["status"]=> + int(9) + ["errorMessage"]=> + string(0) "" + ["numRows"]=> + int(1) + ["numCols"]=> + int(1) + ["affectedRows"]=> + int(0) + ["fetchType"]=> + int(0) +} +object(pq\Result)#%d (6) { + ["status"]=> + int(9) + ["errorMessage"]=> + string(0) "" + ["numRows"]=> + int(1) + ["numCols"]=> + int(1) + ["affectedRows"]=> + int(0) + ["fetchType"]=> + int(0) +} +object(pq\Result)#%d (6) { + ["status"]=> + int(9) + ["errorMessage"]=> + string(0) "" + ["numRows"]=> + int(1) + ["numCols"]=> + int(1) + ["affectedRows"]=> + int(0) + ["fetchType"]=> + int(0) +} +object(pq\Result)#%d (6) { + ["status"]=> + int(2) + ["errorMessage"]=> + string(0) "" + ["numRows"]=> + int(0) + ["numCols"]=> + int(1) + ["affectedRows"]=> + int(3) + ["fetchType"]=> + int(0) +} +DONE \ No newline at end of file