Test props with Connection::prepare() as well as Statement ctor
authorChris Wright <daverandom@php.net>
Mon, 15 Dec 2014 16:19:59 +0000 (16:19 +0000)
committerChris Wright <daverandom@php.net>
Mon, 15 Dec 2014 16:52:42 +0000 (16:52 +0000)
tests/stm_props001.phpt

index 33a733f..9283293 100644 (file)
@@ -9,11 +9,12 @@ include "_skipif.inc";
 echo "Test\n";
 include "_setup.inc";
 
-$n = 'props';
 $q = 'SELECT $1, $2, $3';
 $t = array(pq\Types::BOOL, pq\Types::INT4, pq\Types::TEXT);
 
 $c = new pq\Connection(PQ_DSN);
+
+$n = 'props1';
 $s = new pq\Statement($c, $n, $q, $t);
 
 var_dump($c === $s->connection);
@@ -21,6 +22,14 @@ var_dump($n === $s->name);
 var_dump($q === $s->query);
 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
 --EXPECT--
@@ -29,4 +38,8 @@ bool(true)
 bool(true)
 bool(true)
 bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
 Done