diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/pgsql/tests/02connection.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/pgsql/tests/02connection.phpt')
-rw-r--r-- | ext/pgsql/tests/02connection.phpt | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/ext/pgsql/tests/02connection.phpt b/ext/pgsql/tests/02connection.phpt new file mode 100644 index 0000000..234427b --- /dev/null +++ b/ext/pgsql/tests/02connection.phpt @@ -0,0 +1,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 (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=== |