X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fasync007.phpt;fp=tests%2Fasync007.phpt;h=c2a59f616ce9926a12dac6e0568655454c21e9b0;hb=a4dced008a651f8850669a527987239c9b87f7d3;hp=0000000000000000000000000000000000000000;hpb=de42b70bed81a6f47bbb8f614413ae9a04ec9940;p=m6w6%2Fext-pq diff --git a/tests/async007.phpt b/tests/async007.phpt new file mode 100644 index 0000000..c2a59f6 --- /dev/null +++ b/tests/async007.phpt @@ -0,0 +1,41 @@ +--TEST-- +async statement +--SKIPIF-- + +--FILE-- +busy) { + $r = array($c->socket); + $w = $e = null; + if (stream_select($r, $w, $e, null)) { + $c->poll(); + } + } + } while ($c->getResult()); +} + +$c = new pq\Connection(PQ_DSN); +$t = new pq\Types($c); +$s = new pq\Statement($c, "test1", "SELECT NOW() - \$1", null, true); +complete($s->connection); + +$s->execAsync(array("2012-12-12 12:12:12")); +complete($s->connection); + +$s->descAsync(function($r) use ($t) { + list($typeOid) = $r->desc(); + printf("%s\n", $t[$typeOid]->typname); +}); +complete($s->connection); + +?> +DONE +--EXPECT-- +Test +timestamptz +DONE