1
0
mirror of https://github.com/danog/ext-pq.git synced 2024-11-30 04:19:49 +01:00
ext-pq/tests/stm_deallocate_prepare001.phpt
Chris Wright 7b61b6b19f Add deallocate() and prepare() to Statement
Also adds async variants
2014-12-10 16:50:22 +00:00

39 lines
583 B
PHP

--TEST--
Deallocated and prepare statement
--SKIPIF--
<?php include "_skipif.inc"; ?>
--FILE--
<?php
echo "Test\n";
include "_setup.inc";
$c = new pq\Connection(PQ_DSN);
$s = $c->prepare("test1", "SELECT 'test' || \$1");
$r = $s->exec(array("ing"));
$r->fetchCol($d);
var_dump($d);
$s->deallocate();
try {
$s->exec(array("ing"));
} catch (pq\Exception\BadMethodCallException $e) {
echo "Caught exception\n";
}
$s->prepare();
$r = $s->exec(array("ing"));
$r->fetchCol($d);
var_dump($d);
?>
DONE
--EXPECT--
Test
string(7) "testing"
Caught exception
string(7) "testing"
DONE