mirror of
https://github.com/danog/ext-pq.git
synced 2025-01-22 13:51:20 +01:00
simple persistent connection test
This commit is contained in:
parent
3bb2c115b2
commit
352b77694b
34
tests/persistent001.phpt
Normal file
34
tests/persistent001.phpt
Normal file
@ -0,0 +1,34 @@
|
||||
--TEST--
|
||||
persistent handles
|
||||
--SKIPIF--
|
||||
<?php include "_skipif.inc"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
|
||||
include "_setup.inc";
|
||||
|
||||
for ($i=0; $i<100; ++$i) {
|
||||
$c = new pq\Connection(PQ_DSN, pq\Connection::PERSISTENT);
|
||||
|
||||
if ($i % 2) {
|
||||
$t = new pq\Transaction($c);
|
||||
}
|
||||
|
||||
$c->exec("");
|
||||
}
|
||||
var_dump(raphf\stat_persistent_handles()->{"pq\\Connection"});
|
||||
?>
|
||||
DONE
|
||||
--EXPECTF--
|
||||
Test
|
||||
array(1) {
|
||||
["%s"]=>
|
||||
array(2) {
|
||||
["used"]=>
|
||||
int(1)
|
||||
["free"]=>
|
||||
int(2)
|
||||
}
|
||||
}
|
||||
DONE
|
Loading…
x
Reference in New Issue
Block a user