mirror of
https://github.com/danog/ext-pq.git
synced 2024-12-02 09:18:02 +01:00
Test props with Connection::prepare() as well as Statement ctor
This commit is contained in:
parent
db9b923fd2
commit
4822c94ec2
@ -9,11 +9,12 @@ include "_skipif.inc";
|
|||||||
echo "Test\n";
|
echo "Test\n";
|
||||||
include "_setup.inc";
|
include "_setup.inc";
|
||||||
|
|
||||||
$n = 'props';
|
|
||||||
$q = 'SELECT $1, $2, $3';
|
$q = 'SELECT $1, $2, $3';
|
||||||
$t = array(pq\Types::BOOL, pq\Types::INT4, pq\Types::TEXT);
|
$t = array(pq\Types::BOOL, pq\Types::INT4, pq\Types::TEXT);
|
||||||
|
|
||||||
$c = new pq\Connection(PQ_DSN);
|
$c = new pq\Connection(PQ_DSN);
|
||||||
|
|
||||||
|
$n = 'props1';
|
||||||
$s = new pq\Statement($c, $n, $q, $t);
|
$s = new pq\Statement($c, $n, $q, $t);
|
||||||
|
|
||||||
var_dump($c === $s->connection);
|
var_dump($c === $s->connection);
|
||||||
@ -21,6 +22,14 @@ var_dump($n === $s->name);
|
|||||||
var_dump($q === $s->query);
|
var_dump($q === $s->query);
|
||||||
var_dump($t === $s->types);
|
var_dump($t === $s->types);
|
||||||
|
|
||||||
|
$n = 'props2';
|
||||||
|
$s = $c->prepare($n, $q, $t);
|
||||||
|
|
||||||
|
var_dump($c === $s->connection);
|
||||||
|
var_dump($n === $s->name);
|
||||||
|
var_dump($q === $s->query);
|
||||||
|
var_dump($t === $s->types);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Done
|
Done
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
@ -29,4 +38,8 @@ bool(true)
|
|||||||
bool(true)
|
bool(true)
|
||||||
bool(true)
|
bool(true)
|
||||||
bool(true)
|
bool(true)
|
||||||
|
bool(true)
|
||||||
|
bool(true)
|
||||||
|
bool(true)
|
||||||
|
bool(true)
|
||||||
Done
|
Done
|
||||||
|
Loading…
Reference in New Issue
Block a user