summaryrefslogtreecommitdiff
path: root/ext/pgsql/tests/02connection.phpt
blob: 6288d0e1796ea5c9bc61dc98b0f76756a40085a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--TEST--
PostgreSQL connection
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
// connection function tests

include('config.inc');

$db = pg_pconnect($conn_str);
var_dump($db);

if (pg_connection_status($db) != PGSQL_CONNECTION_OK) 
{
	echo "pg_connection_status() error\n";
}
if (!pg_connection_reset($db)) 
{
	echo "pg_connection_reset() error\n";
}
if (pg_connection_busy($db)) 
{
	echo "pg_connection_busy() error\n";
}
if (function_exists('pg_transaction_status')) {
	if (pg_transaction_status($db) != PGSQL_TRANSACTION_IDLE) 
	{
		echo "pg_transaction_status() error\n";
	}
}
if (!pg_host($db)) 
{
	echo "pg_host() error\n";
}
if (!pg_dbname($db)) 
{
	echo "pg_dbname() error\n";
}
if (!pg_port($db)) 
{
	echo "pg_port() error\n";
}
if (pg_tty($db)) 
{
	echo "pg_tty() error\n";
}
if (pg_options($db)) 
{
	echo "pg_options() error\n";
}

pg_close($db);

?>
===DONE===
--EXPECTF--
resource(%d) of type (pgsql link%s)
===DONE===