type converters
[m6w6/ext-pq] / tests / copy001.phpt
index 4809bb3014042922bfdbfbf98014f2d355b1f952..e0ecc6e72da5ff90729767dd96f1d44f14c8e4f4 100644 (file)
@@ -14,12 +14,28 @@ $c->exec("DROP TABLE IF EXISTS copy_test; CREATE TABLE copy_test (id serial, lin
 $file = file(__FILE__);
 
 $in = new pq\COPY($c, "copy_test (line)", pq\COPY::FROM_STDIN, "DELIMITER '\t'");
+
+var_dump(
+       $c === $in->connection,
+       "copy_test (line)" === $in->expression,
+       pq\COPY::FROM_STDIN === $in->direction,
+       "DELIMITER '\t'" === $in->options
+);
+
 foreach ($file as $i => $line) {
        $in->put(addcslashes($line, "\\\t"));
 }
 $in->end();
 
 $out = new pq\COPY($c, "copy_test (line)", pq\COPY::TO_STDOUT, "DELIMITER '\t'");
+
+var_dump(
+       $c === $out->connection,
+       "copy_test (line)" === $out->expression,
+       pq\COPY::TO_STDOUT === $out->direction,
+       "DELIMITER '\t'" === $out->options
+);
+
 while ($out->get($line)) {
        $lines[] = stripcslashes($line);
 }
@@ -39,5 +55,13 @@ DONE
 --EXPECT--
 Test
 bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
 DONE