php-src/ext/pgsql/tests/02connection.phpt

60 lines
953 B
Plaintext
Raw Normal View History

2001-12-17 00:16:48 +00:00
--TEST--
PostgreSQL connection
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
2003-05-20 00:14:46 +00:00
// connection function tests
include('config.inc');
$db = pg_pconnect($conn_str);
2004-03-09 14:37:49 +00:00
var_dump($db);
2003-05-20 00:14:46 +00:00
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";
}
}
2006-12-12 09:15:25 +00:00
if (false === pg_host($db))
2003-05-20 00:14:46 +00:00
{
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);
2001-12-17 00:16:48 +00:00
?>
2004-03-09 14:37:49 +00:00
===DONE===
--EXPECTF--
resource(%d) of type (pgsql link%s)
===DONE===