xref: /PHP-5.6/ext/pgsql/tests/02connection.phpt (revision f4e63cbe)
1--TEST--
2PostgreSQL connection
3--SKIPIF--
4<?php include("skipif.inc"); ?>
5--FILE--
6<?php
7// connection function tests
8
9include('config.inc');
10
11$db = pg_pconnect($conn_str);
12var_dump($db);
13
14if (pg_connection_status($db) != PGSQL_CONNECTION_OK)
15{
16	echo "pg_connection_status() error\n";
17}
18if (!pg_connection_reset($db))
19{
20	echo "pg_connection_reset() error\n";
21}
22if (pg_connection_busy($db))
23{
24	echo "pg_connection_busy() error\n";
25}
26if (function_exists('pg_transaction_status')) {
27	if (pg_transaction_status($db) != PGSQL_TRANSACTION_IDLE)
28	{
29		echo "pg_transaction_status() error\n";
30	}
31}
32if (false === pg_host($db))
33{
34	echo "pg_host() error\n";
35}
36if (!pg_dbname($db))
37{
38	echo "pg_dbname() error\n";
39}
40if (!pg_port($db))
41{
42	echo "pg_port() error\n";
43}
44if (pg_tty($db))
45{
46	echo "pg_tty() error\n";
47}
48if (pg_options($db))
49{
50	echo "pg_options() error\n";
51}
52
53pg_close($db);
54
55?>
56===DONE===
57--EXPECTF--
58resource(%d) of type (pgsql link%s)
59===DONE===
60