X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=tests%2Fcopy001.phpt;h=e0ecc6e72da5ff90729767dd96f1d44f14c8e4f4;hp=4809bb3014042922bfdbfbf98014f2d355b1f952;hb=280761d6fe87cb4ee24eb750398af80dfb96781f;hpb=ac08c194e71fee0f68559c1ec43f323ecc334019 diff --git a/tests/copy001.phpt b/tests/copy001.phpt index 4809bb3..e0ecc6e 100644 --- a/tests/copy001.phpt +++ b/tests/copy001.phpt @@ -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