X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=tests%2Fasync005.phpt;fp=tests%2Fasync005.phpt;h=0382ade3db069402ba4eb93da16f63add4898c71;hp=0000000000000000000000000000000000000000;hb=8c92aa4bd855482cc76117129e16b42c7ecc57f0;hpb=386aa8e34c335e4aa45a8bdd210baad347550265 diff --git a/tests/async005.phpt b/tests/async005.phpt new file mode 100644 index 0000000..0382ade --- /dev/null +++ b/tests/async005.phpt @@ -0,0 +1,52 @@ +--TEST-- +async prepared statement +--SKIPIF-- + +--FILE-- +connection->busy) { + $r = array($s->connection->socket); + $w = $e = null; + if (stream_select($r, $w, $e, null)) { + $s->connection->poll(); + } + } + } while ($s->connection->getResult()); +} + +$c = new pq\Connection(PQ_DSN); +$s = $c->prepareAsync("test", "SELECT \$1,\$2::int4", array($c->types->byName->int4->oid)); + +complete($s); + +$s->execAsync(array(1,2), function ($res) { + var_dump($res); +}); + +complete($s); + +?> +DONE +--EXPECTF-- +Test +object(pq\Result)#%d (6) { + ["status"]=> + int(2) + ["errorMessage"]=> + string(0) "" + ["numRows"]=> + int(1) + ["numCols"]=> + int(2) + ["affectedRows"]=> + int(1) + ["fetchType"]=> + int(0) +} +DONE \ No newline at end of file