X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fgh-issue015_statements.phpt;fp=tests%2Fgh-issue015_statements.phpt;h=b54664ac4545ba5f1015df27030fba0449cc2da5;hb=df586b558795570822225a3a458bd91a1f7ab433;hp=0000000000000000000000000000000000000000;hpb=1b5358df410e66224c7e8251d286134b0f3f59d3;p=m6w6%2Fext-pq diff --git a/tests/gh-issue015_statements.phpt b/tests/gh-issue015_statements.phpt new file mode 100644 index 0000000..b54664a --- /dev/null +++ b/tests/gh-issue015_statements.phpt @@ -0,0 +1,42 @@ +--TEST-- +restore statements on reset +--SKIPIF-- + +--INI-- +date.timezone=UTC +--FILE-- +prepare("test", "SELECT 1"); +$c->on(pq\Connection::EVENT_RESET, function($conn) { + printf("Connection was reset\n"); +}); + +var_dump($s->exec()->fetchRow()); + +$c->reset(); + +// Fatal error: Uncaught exception 'pq\Exception\DomainException' with message 'ERROR: prepared statement "test" does not exist' +var_dump($s->exec()->fetchRow()); + +?> +===DONE=== +--EXPECT-- +Test +array(1) { + [0]=> + int(1) +} +Connection was reset +array(1) { + [0]=> + int(1) +} +===DONE=== \ No newline at end of file