File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / pgsql / tests / 02connection.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:59 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--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 (false === 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===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>