Skip to content

Commit 202a099

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Add test for pg_put_line() and pg_end_copy()
2 parents b4c200f + 9af6882 commit 202a099

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

ext/pgsql/tests/06copy_2.phpt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
--TEST--
2+
PostgreSQL copy functions, part 2
3+
--EXTENSIONS--
4+
pgsql
5+
--SKIPIF--
6+
<?php include("skipif.inc"); ?>
7+
--FILE--
8+
<?php
9+
10+
include('config.inc');
11+
12+
$db = pg_connect($conn_str);
13+
14+
pg_query($db, 'CREATE TABLE test_copy (x int)');
15+
16+
pg_query($db, 'COPY test_copy FROM STDIN');
17+
18+
pg_put_line($db, "1\n");
19+
pg_put_line($db, "\\N\n");
20+
pg_put_line($db, "\\.\n");
21+
pg_end_copy($db);
22+
23+
var_dump(pg_fetch_all_columns(pg_query($db, 'SELECT * FROM test_copy ORDER BY 1')));
24+
25+
pg_query($db, 'DROP TABLE test_copy');
26+
27+
?>
28+
--EXPECT--
29+
array(2) {
30+
[0]=>
31+
string(1) "1"
32+
[1]=>
33+
NULL
34+
}

0 commit comments

Comments
 (0)