X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=tests%2Fstm_deallocate_prepare001.phpt;fp=tests%2Fstm_deallocate_prepare001.phpt;h=97491b90743274c60dcb70e66b6ea3fc63892d52;hp=0000000000000000000000000000000000000000;hb=7b61b6b19fea328ec2ccd767bf9dd4d4b3c0892f;hpb=56e9738f80aee54b362f90a42c724abad5378e31 diff --git a/tests/stm_deallocate_prepare001.phpt b/tests/stm_deallocate_prepare001.phpt new file mode 100644 index 0000000..97491b9 --- /dev/null +++ b/tests/stm_deallocate_prepare001.phpt @@ -0,0 +1,38 @@ +--TEST-- +Deallocated and prepare statement +--SKIPIF-- + +--FILE-- +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