summaryrefslogtreecommitdiff
path: root/ext/pgsql/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pgsql/tests')
-rw-r--r--ext/pgsql/tests/01createdb.phpt28
-rw-r--r--ext/pgsql/tests/02connection.phpt59
-rw-r--r--ext/pgsql/tests/03sync_query.phpt73
-rw-r--r--ext/pgsql/tests/04async_query.phpt65
-rw-r--r--ext/pgsql/tests/05large_object.phpt82
-rw-r--r--ext/pgsql/tests/06copy.phpt22
-rw-r--r--ext/pgsql/tests/07optional.phpt24
-rw-r--r--ext/pgsql/tests/08escape.phpt68
-rw-r--r--ext/pgsql/tests/09notice.phpt29
-rw-r--r--ext/pgsql/tests/10pg_convert.phpt26
-rw-r--r--ext/pgsql/tests/11pg_meta_data.phpt64
-rw-r--r--ext/pgsql/tests/12pg_insert.phpt21
-rw-r--r--ext/pgsql/tests/13pg_select.phpt34
-rw-r--r--ext/pgsql/tests/14pg_update.phpt22
-rw-r--r--ext/pgsql/tests/15pg_delete.phpt23
-rw-r--r--ext/pgsql/tests/16pg_result_status.phpt19
-rw-r--r--ext/pgsql/tests/17result.phpt67
-rw-r--r--ext/pgsql/tests/18pg_escape_bytea.phpt28
-rw-r--r--ext/pgsql/tests/19pg_ping.phpt15
-rw-r--r--ext/pgsql/tests/20pg_get_pid.phpt17
-rw-r--r--ext/pgsql/tests/21pg_get_notify.phpt20
-rwxr-xr-xext/pgsql/tests/22pg_fetch_object.phpt37
-rw-r--r--ext/pgsql/tests/23sync_query_params.phpt59
-rw-r--r--ext/pgsql/tests/24sync_query_prepared.phpt65
-rw-r--r--ext/pgsql/tests/25async_query_params.phpt70
-rw-r--r--ext/pgsql/tests/26async_query_prepared.phpt106
-rw-r--r--ext/pgsql/tests/80_bug14383.phpt37
-rwxr-xr-xext/pgsql/tests/80_bug24499.phpt66
-rwxr-xr-xext/pgsql/tests/80_bug27597.phpt60
-rwxr-xr-xext/pgsql/tests/80_bug32223.phpt55
-rwxr-xr-xext/pgsql/tests/80_bug32223b.phpt57
-rwxr-xr-xext/pgsql/tests/80_bug36625.phpt49
-rw-r--r--ext/pgsql/tests/98old_api.phpt33
-rw-r--r--ext/pgsql/tests/9999dropdb.phpt18
-rw-r--r--ext/pgsql/tests/README16
-rw-r--r--ext/pgsql/tests/config.inc12
-rw-r--r--ext/pgsql/tests/php.gifbin3872 -> 0 bytes
-rw-r--r--ext/pgsql/tests/skipif.inc18
38 files changed, 0 insertions, 1564 deletions
diff --git a/ext/pgsql/tests/01createdb.phpt b/ext/pgsql/tests/01createdb.phpt
deleted file mode 100644
index 15849396c6..0000000000
--- a/ext/pgsql/tests/01createdb.phpt
+++ /dev/null
@@ -1,28 +0,0 @@
---TEST--
-PostgreSQL create db
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-// create test table
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-if (!@pg_num_rows(@pg_query($db, "SELECT * FROM ".$table_name)))
-{
- @pg_query($db,$table_def); // Create table here
- for ($i=0; $i < $num_test_record; $i++) {
- pg_query($db,"INSERT INTO ".$table_name." VALUES ($i, 'ABC');");
- }
-}
-else {
- echo pg_last_error()."\n";
-}
-
-pg_close($db);
-
-echo "OK";
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/02connection.phpt b/ext/pgsql/tests/02connection.phpt
deleted file mode 100644
index 6288d0e179..0000000000
--- a/ext/pgsql/tests/02connection.phpt
+++ /dev/null
@@ -1,59 +0,0 @@
---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===
diff --git a/ext/pgsql/tests/03sync_query.phpt b/ext/pgsql/tests/03sync_query.phpt
deleted file mode 100644
index afb6bb4475..0000000000
--- a/ext/pgsql/tests/03sync_query.phpt
+++ /dev/null
@@ -1,73 +0,0 @@
---TEST--
-PostgreSQL sync query
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-
-$result = pg_query($db, "SELECT * FROM ".$table_name.";");
-if (!($rows = pg_num_rows($result)))
-{
- echo "pg_num_row() error\n";
-}
-for ($i=0; $i < $rows; $i++)
-{
- pg_fetch_array($result, $i, PGSQL_NUM);
-}
-for ($i=0; $i < $rows; $i++)
-{
- pg_fetch_object($result);
-}
-for ($i=0; $i < $rows; $i++)
-{
- pg_fetch_row($result, $i);
-}
-for ($i=0; $i < $rows; $i++)
-{
- pg_fetch_result($result, $i, 0);
-}
-
-pg_result_error($result);
-if (function_exists('pg_result_error_field')) {
- pg_result_error_field($result, PGSQL_DIAG_SEVERITY);
- pg_result_error_field($result, PGSQL_DIAG_SQLSTATE);
- pg_result_error_field($result, PGSQL_DIAG_MESSAGE_PRIMARY);
- pg_result_error_field($result, PGSQL_DIAG_MESSAGE_DETAIL);
- pg_result_error_field($result, PGSQL_DIAG_MESSAGE_HINT);
- pg_result_error_field($result, PGSQL_DIAG_STATEMENT_POSITION);
- if (defined('PGSQL_DIAG_INTERNAL_POSITION'))
- {
- pg_result_error_field($result, PGSQL_DIAG_INTERNAL_POSITION);
- }
- if (defined('PGSQL_DIAG_INTERNAL_QUERY'))
- {
- pg_result_error_field($result, PGSQL_DIAG_INTERNAL_QUERY);
- }
- pg_result_error_field($result, PGSQL_DIAG_CONTEXT);
- pg_result_error_field($result, PGSQL_DIAG_SOURCE_FILE);
- pg_result_error_field($result, PGSQL_DIAG_SOURCE_LINE);
- pg_result_error_field($result, PGSQL_DIAG_SOURCE_FUNCTION);
-}
-pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";"));
-pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";"));
-pg_field_name($result, 0);
-pg_field_num($result, $field_name);
-pg_field_size($result, 0);
-pg_field_type($result, 0);
-pg_field_prtlen($result, 0);
-pg_field_is_null($result, 0);
-
-$result = pg_query($db, "INSERT INTO ".$table_name." VALUES (9999, 'ABC');");
-pg_last_oid($result);
-
-pg_free_result($result);
-pg_close($db);
-
-echo "OK";
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/04async_query.phpt b/ext/pgsql/tests/04async_query.phpt
deleted file mode 100644
index 7711240a79..0000000000
--- a/ext/pgsql/tests/04async_query.phpt
+++ /dev/null
@@ -1,65 +0,0 @@
---TEST--
-PostgreSQL async query
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-
-if (!pg_send_query($db, "SELECT * FROM ".$table_name.";")) {
- echo "pg_send_query() error\n";
-}
-while(pg_connection_busy($db)); // busy wait: intended
-if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
- echo "pg_connection_status() error\n";
-}
-if (!($result = pg_get_result($db)))
-{
- echo "pg_get_result() error\n";
-}
-
-if (!($rows = pg_num_rows($result))) {
- echo "pg_num_rows() error\n";
-}
-for ($i=0; $i < $rows; $i++)
-{
- pg_fetch_array($result, $i, PGSQL_NUM);
-}
-for ($i=0; $i < $rows; $i++)
-{
- pg_fetch_object($result);
-}
-for ($i=0; $i < $rows; $i++)
-{
- pg_fetch_row($result, $i);
-}
-for ($i=0; $i < $rows; $i++)
-{
- pg_fetch_result($result, $i, 0);
-}
-
-pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";"));
-pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";"));
-pg_field_name($result, 0);
-pg_field_num($result, $field_name);
-pg_field_size($result, 0);
-pg_field_type($result, 0);
-pg_field_prtlen($result, 0);
-pg_field_is_null($result, 0);
-
-if (!pg_send_query($db, "INSERT INTO ".$table_name." VALUES (8888, 'GGG');"))
-{
- echo "pg_send_query() error\n";
-}
-
-pg_last_oid($result);
-pg_free_result($result);
-
-
-echo "OK";
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/05large_object.phpt b/ext/pgsql/tests/05large_object.phpt
deleted file mode 100644
index a6f30195ae..0000000000
--- a/ext/pgsql/tests/05large_object.phpt
+++ /dev/null
@@ -1,82 +0,0 @@
---TEST--
-PostgreSQL large object
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-
-echo "create/write/close LO\n";
-pg_exec ($db, "begin");
-$oid = pg_lo_create ($db);
-if (!$oid) echo ("pg_lo_create() error\n");
-$handle = pg_lo_open ($db, $oid, "w");
-if (!$handle) echo ("pg_lo_open() error\n");
-pg_lo_write ($handle, "large object data\n");
-pg_lo_close ($handle);
-pg_exec ($db, "commit");
-
-echo "open/read/tell/seek/close LO\n";
-pg_exec ($db, "begin");
-$handle = pg_lo_open ($db, $oid, "w");
-pg_lo_read($handle, 100);
-pg_lo_tell($handle);
-pg_lo_seek($handle, 2);
-pg_lo_close($handle);
-pg_exec ($db, "commit");
-
-echo "open/read_all/close LO\n";
-pg_exec ($db, "begin");
-$handle = pg_lo_open ($db, $oid, "w");
-pg_lo_read_all($handle);
-if (pg_last_error()) echo "pg_lo_read_all() error\n".pg_last_error();
-pg_lo_close($handle);
-pg_exec ($db, "commit");
-
-echo "unlink LO\n";
-pg_exec ($db, "begin");
-pg_lo_unlink($db, $oid) or print("pg_lo_unlink() error 1\n");
-pg_exec ($db, "commit");
-
-// more pg_lo_unlink() tests
-echo "Test without connection\n";
-pg_exec ($db, "begin");
-$oid = pg_lo_create ($db) or print("pg_lo_create() error\n");
-pg_lo_unlink($oid) or print("pg_lo_unlink() error 2\n");
-pg_exec ($db, "commit");
-
-echo "Test with string oid value\n";
-pg_exec ($db, "begin");
-$oid = pg_lo_create ($db) or print("pg_lo_create() error\n");
-pg_lo_unlink($db, (string)$oid) or print("pg_lo_unlink() error 3\n");
-pg_exec ($db, "commit");
-
-echo "import/export LO\n";
-$path = dirname(__FILE__) . '/';
-pg_query($db, 'begin');
-$oid = pg_lo_import($db, $path . 'php.gif');
-pg_query($db, 'commit');
-pg_query($db, 'begin');
-@unlink($path . 'php.gif.exported');
-pg_lo_export($oid, $path . 'php.gif.exported', $db);
-if (!file_exists($path . 'php.gif.exported')) {
- echo "Export failed\n";
-}
-@unlink($path . 'php.gif.exported');
-pg_query($db, 'commit');
-
-echo "OK";
-?>
---EXPECT--
-create/write/close LO
-open/read/tell/seek/close LO
-open/read_all/close LO
-large object data
-unlink LO
-Test without connection
-Test with string oid value
-import/export LO
-OK
diff --git a/ext/pgsql/tests/06copy.phpt b/ext/pgsql/tests/06copy.phpt
deleted file mode 100644
index bed783a6f8..0000000000
--- a/ext/pgsql/tests/06copy.phpt
+++ /dev/null
@@ -1,22 +0,0 @@
---TEST--
-PostgreSQL copy functions
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-
-$rows = pg_copy_to($db, $table_name);
-
-pg_query($db, "DELETE FROM $table_name");
-
-pg_copy_from($db, $table_name, $rows);
-
-echo "OK";
-
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/07optional.phpt b/ext/pgsql/tests/07optional.phpt
deleted file mode 100644
index 9fa6f16331..0000000000
--- a/ext/pgsql/tests/07optional.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-PostgreSQL optional functions
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-// optional functions
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-$enc = pg_client_encoding($db);
-
-pg_set_client_encoding($db, $enc);
-
-if (function_exists('pg_set_error_verbosity')) {
- pg_set_error_verbosity(PGSQL_ERRORS_TERSE);
- pg_set_error_verbosity(PGSQL_ERRORS_DEFAULT);
- pg_set_error_verbosity(PGSQL_ERRORS_VERBOSE);
-}
-echo "OK";
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt
deleted file mode 100644
index cf23b50e3a..0000000000
--- a/ext/pgsql/tests/08escape.phpt
+++ /dev/null
@@ -1,68 +0,0 @@
---TEST--
-PostgreSQL escape functions
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-
-include 'config.inc';
-define('FILE_NAME', dirname(__FILE__) . '/php.gif');
-
-// pg_escape_string() test
-$before = "ABC\\ABC\'";
-$expect = "ABC\\\\ABC\\'";
-$after = pg_escape_string($before);
-if ($expect === $after) {
- echo "pg_escape_string() is Ok\n";
-}
-else {
- echo "pg_escape_string() is NOT Ok\n";
- var_dump($before);
- var_dump($after);
- var_dump($expect);
-}
-
-// pg_escape_bytea() test
-$before = "ABC\\ABC";
-$expect = "ABC\\\\\\\\ABC";
-$after = pg_escape_bytea($before);
-if ($expect === $after) {
- echo "pg_escape_bytea() is Ok\n";
-}
-else {
- echo "pg_escape_byte() is NOT Ok\n";
- var_dump($before);
- var_dump($after);
- var_dump($expect);
-}
-
-// Test using database
-$data = file_get_contents(FILE_NAME);
-$db = pg_connect($conn_str);
-
-// Insert binary to DB
-$escaped_data = pg_escape_bytea($data);
-pg_query("DELETE FROM ".$table_name." WHERE num = -9999;");
-$sql = "INSERT INTO ".$table_name." (num, bin) VALUES (-9999, CAST ('".$escaped_data."' AS BYTEA));";
-pg_query($db, $sql);
-
-// Retrieve binary from DB
-$sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = -9999";
-$result = pg_query($db, $sql);
-$row = pg_fetch_array($result, 0, PGSQL_ASSOC);
-
-if ($data === pg_unescape_bytea($row['bin'])) {
- echo "pg_escape_bytea() actually works with database\n";
-}
-else {
- echo "pg_escape_bytea() is broken\n";
-}
-
-?>
---EXPECT--
-pg_escape_string() is NOT Ok
-string(9) "ABC\ABC\'"
-string(12) "ABC\\ABC\\''"
-string(10) "ABC\\ABC\'"
-pg_escape_bytea() is Ok
-pg_escape_bytea() actually works with database
diff --git a/ext/pgsql/tests/09notice.phpt b/ext/pgsql/tests/09notice.phpt
deleted file mode 100644
index b7611b98c1..0000000000
--- a/ext/pgsql/tests/09notice.phpt
+++ /dev/null
@@ -1,29 +0,0 @@
---TEST--
-PostgreSQL notice function
---SKIPIF--
-<?php include("skipif.inc"); ?>
---INI--
-pgsql.log_notice=1
-pgsql.ignore_notices=0
---FILE--
-<?php
-include 'config.inc';
-
-$db = pg_connect($conn_str);
-pg_exec($db, "SET LC_MESSAGES='C';");
-pg_query($db, "BEGIN;");
-pg_query($db, "BEGIN;");
-
-$msg = pg_last_notice($db);
-if ($msg === FALSE) {
- echo "Cannot find notice message in hash\n";
- var_dump($msg);
-}
-echo $msg."\n";
-echo "pg_last_notice() is Ok\n";
-
-?>
---EXPECTF--
-Notice: pg_query(): %s already a transaction in progress in %s on line %d
-%s already a transaction in progress
-pg_last_notice() is Ok
diff --git a/ext/pgsql/tests/10pg_convert.phpt b/ext/pgsql/tests/10pg_convert.phpt
deleted file mode 100644
index b88b8e5798..0000000000
--- a/ext/pgsql/tests/10pg_convert.phpt
+++ /dev/null
@@ -1,26 +0,0 @@
---TEST--
-PostgreSQL pg_convert()
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-error_reporting(E_ALL);
-
-include 'config.inc';
-
-$db = pg_connect($conn_str);
-
-$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB');
-$converted = pg_convert($db, $table_name, $fields);
-
-var_dump($converted);
-?>
---EXPECT--
-array(3) {
- ["num"]=>
- string(4) "1234"
- ["str"]=>
- string(5) "'AAA'"
- ["bin"]=>
- string(5) "'BBB'"
-}
diff --git a/ext/pgsql/tests/11pg_meta_data.phpt b/ext/pgsql/tests/11pg_meta_data.phpt
deleted file mode 100644
index a7f8ed47fc..0000000000
--- a/ext/pgsql/tests/11pg_meta_data.phpt
+++ /dev/null
@@ -1,64 +0,0 @@
---TEST--
-PostgreSQL pg_metadata()
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-error_reporting(E_ALL);
-
-include 'config.inc';
-
-$db = pg_connect($conn_str);
-
-$meta = pg_meta_data($db, $table_name);
-
-var_dump($meta);
-?>
---EXPECT--
-array(3) {
- ["num"]=>
- array(6) {
- ["num"]=>
- int(1)
- ["type"]=>
- string(4) "int4"
- ["len"]=>
- int(4)
- ["not null"]=>
- bool(false)
- ["has default"]=>
- bool(false)
- ["array dims"]=>
- int(0)
- }
- ["str"]=>
- array(6) {
- ["num"]=>
- int(2)
- ["type"]=>
- string(4) "text"
- ["len"]=>
- int(-1)
- ["not null"]=>
- bool(false)
- ["has default"]=>
- bool(false)
- ["array dims"]=>
- int(0)
- }
- ["bin"]=>
- array(6) {
- ["num"]=>
- int(3)
- ["type"]=>
- string(5) "bytea"
- ["len"]=>
- int(-1)
- ["not null"]=>
- bool(false)
- ["has default"]=>
- bool(false)
- ["array dims"]=>
- int(0)
- }
-}
diff --git a/ext/pgsql/tests/12pg_insert.phpt b/ext/pgsql/tests/12pg_insert.phpt
deleted file mode 100644
index 8d98f220fd..0000000000
--- a/ext/pgsql/tests/12pg_insert.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-PostgreSQL pg_insert()
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-error_reporting(E_ALL);
-
-include 'config.inc';
-
-$db = pg_connect($conn_str);
-$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB');
-
-pg_insert($db, $table_name, $fields) or print "Error in test 1\n";
-echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n";
-
-echo "Ok\n";
-?>
---EXPECT--
-INSERT INTO php_pgsql_test (num,str,bin) VALUES (1234,'AAA','BBB');
-Ok
diff --git a/ext/pgsql/tests/13pg_select.phpt b/ext/pgsql/tests/13pg_select.phpt
deleted file mode 100644
index 55e88db731..0000000000
--- a/ext/pgsql/tests/13pg_select.phpt
+++ /dev/null
@@ -1,34 +0,0 @@
---TEST--
-PostgreSQL pg_select()
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-error_reporting(E_ALL);
-
-include 'config.inc';
-
-$db = pg_connect($conn_str);
-$fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ');
-$ids = array('num'=>'1234');
-
-$res = pg_select($db, $table_name, $ids) or print "Error\n";
-var_dump($res);
-echo pg_select($db, $table_name, $ids, PGSQL_DML_STRING)."\n";
-echo "Ok\n";
-
-?>
---EXPECT--
-array(1) {
- [0]=>
- array(3) {
- ["num"]=>
- string(4) "1234"
- ["str"]=>
- string(3) "AAA"
- ["bin"]=>
- string(3) "BBB"
- }
-}
-SELECT * FROM php_pgsql_test WHERE num=1234;
-Ok
diff --git a/ext/pgsql/tests/14pg_update.phpt b/ext/pgsql/tests/14pg_update.phpt
deleted file mode 100644
index ef8d7e49bd..0000000000
--- a/ext/pgsql/tests/14pg_update.phpt
+++ /dev/null
@@ -1,22 +0,0 @@
---TEST--
-PostgreSQL pg_update()
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-error_reporting(E_ALL);
-
-include 'config.inc';
-
-$db = pg_connect($conn_str);
-$fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ');
-$ids = array('num'=>'1234');
-
-pg_update($db, $table_name, $fields, $ids) or print "Error in test 1\n";
-echo pg_update($db, $table_name, $fields, $ids, PGSQL_DML_STRING)."\n";
-
-echo "Ok\n";
-?>
---EXPECT--
-UPDATE php_pgsql_test SET num=1234,str='ABC',bin='XYZ' WHERE num=1234;
-Ok
diff --git a/ext/pgsql/tests/15pg_delete.phpt b/ext/pgsql/tests/15pg_delete.phpt
deleted file mode 100644
index e35f4ba78e..0000000000
--- a/ext/pgsql/tests/15pg_delete.phpt
+++ /dev/null
@@ -1,23 +0,0 @@
---TEST--
-PostgreSQL pg_delete()
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-error_reporting(E_ALL);
-
-include 'config.inc';
-
-$db = pg_connect($conn_str);
-
-$fields = array('num'=>'1234', 'str'=>'XXX', 'bin'=>'YYY');
-$ids = array('num'=>'1234');
-if (!pg_delete($db, $table_name, $ids)) {
- echo "Error\n";
-}
-else {
- echo "Ok\n";
-}
-?>
---EXPECT--
-Ok
diff --git a/ext/pgsql/tests/16pg_result_status.phpt b/ext/pgsql/tests/16pg_result_status.phpt
deleted file mode 100644
index 268dc9fd64..0000000000
--- a/ext/pgsql/tests/16pg_result_status.phpt
+++ /dev/null
@@ -1,19 +0,0 @@
---TEST--
-PostgreSQL pg_result_status()
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-include 'config.inc';
-
-$db = pg_connect($conn_str);
-
-$sql = "SELECT * FROM ".$table_name." WHERE num = -2";
-$result = pg_query($db, "BEGIN;END");
-
-echo pg_result_status($result)."\n";
-echo pg_result_status($result, PGSQL_STATUS_STRING)."\n";
-?>
---EXPECT--
-1
-COMMIT
diff --git a/ext/pgsql/tests/17result.phpt b/ext/pgsql/tests/17result.phpt
deleted file mode 100644
index c3f9959aa2..0000000000
--- a/ext/pgsql/tests/17result.phpt
+++ /dev/null
@@ -1,67 +0,0 @@
---TEST--
-PostgreSQL pg_fetch_*() functions
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-error_reporting(E_ALL);
-
-include 'config.inc';
-
-$db = pg_connect($conn_str);
-
-$sql = "SELECT * FROM $table_name";
-$result = pg_query($db, $sql) or die('Cannot qeury db');
-$rows = pg_num_rows($result);
-
-var_dump(pg_result_seek($result, 1));
-var_dump(pg_fetch_object($result));
-var_dump(pg_fetch_array($result, 1));
-var_dump(pg_fetch_row($result, 1));
-var_dump(pg_fetch_assoc($result, 1));
-var_dump(pg_result_seek($result, 0));
-
-echo "Ok\n";
-?>
---EXPECT--
-bool(true)
-object(stdClass)#1 (3) {
- ["num"]=>
- string(1) "1"
- ["str"]=>
- string(3) "ABC"
- ["bin"]=>
- NULL
-}
-array(6) {
- [0]=>
- string(1) "1"
- ["num"]=>
- string(1) "1"
- [1]=>
- string(3) "ABC"
- ["str"]=>
- string(3) "ABC"
- [2]=>
- NULL
- ["bin"]=>
- NULL
-}
-array(3) {
- [0]=>
- string(1) "1"
- [1]=>
- string(3) "ABC"
- [2]=>
- NULL
-}
-array(3) {
- ["num"]=>
- string(1) "1"
- ["str"]=>
- string(3) "ABC"
- ["bin"]=>
- NULL
-}
-bool(true)
-Ok
diff --git a/ext/pgsql/tests/18pg_escape_bytea.phpt b/ext/pgsql/tests/18pg_escape_bytea.phpt
deleted file mode 100644
index 43f98c4467..0000000000
--- a/ext/pgsql/tests/18pg_escape_bytea.phpt
+++ /dev/null
@@ -1,28 +0,0 @@
---TEST--
-PostgreSQL pg_escape_bytea() functions
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-// optional functions
-
-include('config.inc');
-
-$image = file_get_contents(dirname(__FILE__) . '/php.gif');
-$esc_image = pg_escape_bytea($image);
-
-$db = pg_connect($conn_str);
-pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');');
-$result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876');
-$rows = pg_fetch_all($result);
-$unesc_image = pg_unescape_bytea($rows[0]['bin']);
-
-if ($unesc_image !== $image) {
- echo "NG";
-}
-else {
- echo "OK";
-}
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/19pg_ping.phpt b/ext/pgsql/tests/19pg_ping.phpt
deleted file mode 100644
index 9059bde470..0000000000
--- a/ext/pgsql/tests/19pg_ping.phpt
+++ /dev/null
@@ -1,15 +0,0 @@
---TEST--
-PostgreSQL pg_ping() functions
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-// optional functions
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-var_dump(pg_ping($db));
-?>
---EXPECT--
-bool(true)
diff --git a/ext/pgsql/tests/20pg_get_pid.phpt b/ext/pgsql/tests/20pg_get_pid.phpt
deleted file mode 100644
index 06cdfa8656..0000000000
--- a/ext/pgsql/tests/20pg_get_pid.phpt
+++ /dev/null
@@ -1,17 +0,0 @@
---TEST--
-PostgreSQL pg_get_pid() functions
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-// optional functions
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-$pid = pg_get_pid($db);
-
-is_integer($pid) ? print 'OK' : print 'NG';
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/21pg_get_notify.phpt b/ext/pgsql/tests/21pg_get_notify.phpt
deleted file mode 100644
index 9171fc01aa..0000000000
--- a/ext/pgsql/tests/21pg_get_notify.phpt
+++ /dev/null
@@ -1,20 +0,0 @@
---TEST--
-PostgreSQL pg_get_notify() functions
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-// optional functions
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-pg_query($db, 'LISTEN test_msg');
-pg_query($db, 'NOTIFY test_msg');
-
-$msg = pg_get_notify($db);
-
-isset($msg['message'],$msg['pid']) ? print 'OK' : print 'NG';
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/22pg_fetch_object.phpt b/ext/pgsql/tests/22pg_fetch_object.phpt
deleted file mode 100755
index 4f2f5dc184..0000000000
--- a/ext/pgsql/tests/22pg_fetch_object.phpt
+++ /dev/null
@@ -1,37 +0,0 @@
---TEST--
-PostgreSQL pg_fetch_object()
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-error_reporting(E_ALL);
-
-include 'config.inc';
-
-class test_class {
- function __construct($arg1, $arg2) {
- echo __METHOD__ . "($arg1,$arg2)\n";
- }
-}
-
-$db = pg_connect($conn_str);
-
-$sql = "SELECT * FROM $table_name";
-$result = pg_query($db, $sql) or die('Cannot qeury db');
-$rows = pg_num_rows($result);
-
-var_dump(pg_fetch_object($result, NULL, 'test_class', array(1, 2)));
-
-echo "Ok\n";
-?>
---EXPECT--
-test_class::__construct(1,2)
-object(test_class)#1 (3) {
- ["num"]=>
- string(1) "0"
- ["str"]=>
- string(3) "ABC"
- ["bin"]=>
- NULL
-}
-Ok
diff --git a/ext/pgsql/tests/23sync_query_params.phpt b/ext/pgsql/tests/23sync_query_params.phpt
deleted file mode 100644
index 6959cd75a7..0000000000
--- a/ext/pgsql/tests/23sync_query_params.phpt
+++ /dev/null
@@ -1,59 +0,0 @@
---TEST--
-PostgreSQL sync query params
---SKIPIF--
-<?php
-include("skipif.inc");
-if (!function_exists('pg_query_params')) die('skip function pg_query_params() does not exist');
-?>
---FILE--
-<?php
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-
-$version = pg_version($db);
-if ($version['protocol'] >= 3) {
- $result = pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100));
- if (!($rows = pg_num_rows($result)))
- {
- echo "pg_num_row() error\n";
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_array($result, $i, PGSQL_NUM);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_object($result);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_row($result, $i);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_result($result, $i, 0);
- }
-
- pg_result_error($result);
- pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
- pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
- pg_field_name($result, 0);
- pg_field_num($result, $field_name);
- pg_field_size($result, 0);
- pg_field_type($result, 0);
- pg_field_prtlen($result, 0);
- pg_field_is_null($result, 0);
-
- $result = pg_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC"));
- pg_last_oid($result);
-
- pg_free_result($result);
-}
-pg_close($db);
-
-echo "OK";
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/24sync_query_prepared.phpt b/ext/pgsql/tests/24sync_query_prepared.phpt
deleted file mode 100644
index ea8f14661a..0000000000
--- a/ext/pgsql/tests/24sync_query_prepared.phpt
+++ /dev/null
@@ -1,65 +0,0 @@
---TEST--
-PostgreSQL sync prepared queries
---SKIPIF--
-<?php
-include("skipif.inc");
-if (!function_exists('pg_prepare')) die('skip function pg_prepare() does not exist');
-?>
---FILE--
-<?php
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-
-$version = pg_version($db);
-if ($version['protocol'] >= 3) {
- $result = pg_prepare($db, "php_test", "SELECT * FROM ".$table_name." WHERE num > \$1;");
- pg_result_error($result);
- pg_free_result($result);
- $result = pg_execute($db, "php_test", array(100));
- if (!($rows = pg_num_rows($result)))
- {
- echo "pg_num_row() error\n";
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_array($result, $i, PGSQL_NUM);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_object($result);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_row($result, $i);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_result($result, $i, 0);
- }
-
- pg_result_error($result);
- pg_num_rows(pg_execute($db, "php_test", array(100)));
- pg_num_fields(pg_execute($db, "php_test", array(100)));
- pg_field_name($result, 0);
- pg_field_num($result, $field_name);
- pg_field_size($result, 0);
- pg_field_type($result, 0);
- pg_field_prtlen($result, 0);
- pg_field_is_null($result, 0);
-
- $result = pg_prepare($db, "php_test2", "INSERT INTO ".$table_name." VALUES (\$1, \$2);");
- pg_result_error($result);
- pg_free_result($result);
- $result = pg_execute($db, "php_test2", array(9999, "A'BC"));
- pg_last_oid($result);
-
- pg_free_result($result);
-}
-pg_close($db);
-
-echo "OK";
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/25async_query_params.phpt b/ext/pgsql/tests/25async_query_params.phpt
deleted file mode 100644
index 6e7dafe34b..0000000000
--- a/ext/pgsql/tests/25async_query_params.phpt
+++ /dev/null
@@ -1,70 +0,0 @@
---TEST--
-PostgreSQL async query params
---SKIPIF--
-<?php
-include("skipif.inc");
-if (!function_exists('pg_send_query_params')) die('skip function pg_send_query_params() does not exist');
-?>
---FILE--
-<?php
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-
-$version = pg_version($db);
-if ($version['protocol'] >= 3) {
- if (!pg_send_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100))) {
- echo "pg_send_query_params() error\n";
- }
- while(pg_connection_busy($db)); // busy wait: intended
- if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
- echo "pg_connection_status() error\n";
- }
- if (!($result = pg_get_result($db)))
- {
- echo "pg_get_result() error\n";
- }
- if (!($rows = pg_num_rows($result))) {
- echo "pg_num_rows() error\n";
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_array($result, $i, PGSQL_NUM);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_object($result);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_row($result, $i);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_result($result, $i, 0);
- }
-
- pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
- pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
- pg_field_name($result, 0);
- pg_field_num($result, $field_name);
- pg_field_size($result, 0);
- pg_field_type($result, 0);
- pg_field_prtlen($result, 0);
- pg_field_is_null($result, 0);
-
- if (!pg_send_query_params($db, "INSERT INTO ".$table_name." VALUES (\$1, \$2);", array(9999, "A'BC")))
- {
- echo "pg_send_query_params() error\n";
- }
-
- pg_last_oid($result);
- pg_free_result($result);
-}
-pg_close($db);
-
-echo "OK";
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/26async_query_prepared.phpt b/ext/pgsql/tests/26async_query_prepared.phpt
deleted file mode 100644
index bda363b750..0000000000
--- a/ext/pgsql/tests/26async_query_prepared.phpt
+++ /dev/null
@@ -1,106 +0,0 @@
---TEST--
-PostgreSQL async prepared queries
---SKIPIF--
-<?php
-include("skipif.inc");
-if (!function_exists('pg_send_prepare')) die('skip function pg_send_prepare() does not exist');
-?>
---FILE--
-<?php
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-
-$version = pg_version($db);
-if ($version['protocol'] >= 3) {
- if (!pg_send_prepare($db, 'php_test', "SELECT * FROM ".$table_name." WHERE num > \$1;")) {
- echo "pg_send_prepare() error\n";
- }
- while(pg_connection_busy($db)); // busy wait: intended
- if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
- echo "pg_connection_status() error\n";
- }
- if (!($result = pg_get_result($db)))
- {
- echo "pg_get_result() error\n";
- }
- pg_free_result($result);
-
- if (!pg_send_execute($db, 'php_test', array(100))) {
- echo "pg_send_execute() error\n";
- }
- while(pg_connection_busy($db)); // busy wait: intended
- if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
- echo "pg_connection_status() error\n";
- }
- if (!($result = pg_get_result($db)))
- {
- echo "pg_get_result() error\n";
- }
-
- if (!($rows = pg_num_rows($result))) {
- echo "pg_num_rows() error\n";
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_array($result, $i, PGSQL_NUM);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_object($result);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_row($result, $i);
- }
- for ($i=0; $i < $rows; $i++)
- {
- pg_fetch_result($result, $i, 0);
- }
-
- pg_num_rows(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
- pg_num_fields(pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num > \$1;", array(100)));
- pg_field_name($result, 0);
- pg_field_num($result, $field_name);
- pg_field_size($result, 0);
- pg_field_type($result, 0);
- pg_field_prtlen($result, 0);
- pg_field_is_null($result, 0);
-
- if (!pg_send_prepare($db, "php_test2", "INSERT INTO ".$table_name." VALUES (\$1, \$2);"))
- {
- echo "pg_send_prepare() error\n";
- }
- while(pg_connection_busy($db)); // busy wait: intended
- if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
- echo "pg_connection_status() error\n";
- }
- if (!($result = pg_get_result($db)))
- {
- echo "pg_get_result() error\n";
- }
- pg_free_result($result);
-
- if (!pg_send_execute($db, "php_test2", array(9999, "A'BC")))
- {
- echo "pg_send_execute() error\n";
- }
- while(pg_connection_busy($db)); // busy wait: intended
- if (pg_connection_status($db) === PGSQL_CONNECTION_BAD) {
- echo "pg_connection_status() error\n";
- }
- if (!($result = pg_get_result($db)))
- {
- echo "pg_get_result() error\n";
- }
-
- pg_last_oid($result);
- pg_free_result($result);
-}
-pg_close($db);
-
-echo "OK";
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/80_bug14383.phpt b/ext/pgsql/tests/80_bug14383.phpt
deleted file mode 100644
index c60e11c19a..0000000000
--- a/ext/pgsql/tests/80_bug14383.phpt
+++ /dev/null
@@ -1,37 +0,0 @@
---TEST--
-Bug #14383
---SKIPIF--
-<?php
-require_once(dirname(__FILE__).'/../../dba/tests/skipif.inc');
-require_once('skipif.inc');
-?>
---FILE--
-<?php
-require_once('config.inc');
-
-$dbh = @pg_connect($conn_str);
-if (!$dbh) {
- die ("Could not connect to the server");
-}
-pg_close($dbh);
-
-require_once(dirname(__FILE__).'/../../dba/tests/test.inc');
-require_once(dirname(__FILE__).'/../../dba/tests/dba_handler.inc');
-
-?>
---EXPECTF--
-database handler: %s
-3NYNYY
-Content String 2
-Content 2 replaced
-Read during write:%sallowed
-Content 2 replaced 2nd time
-The 6th value
-array(3) {
- ["key number 6"]=>
- string(13) "The 6th value"
- ["key2"]=>
- string(27) "Content 2 replaced 2nd time"
- ["key5"]=>
- string(23) "The last content string"
-} \ No newline at end of file
diff --git a/ext/pgsql/tests/80_bug24499.phpt b/ext/pgsql/tests/80_bug24499.phpt
deleted file mode 100755
index ddb3c58a21..0000000000
--- a/ext/pgsql/tests/80_bug24499.phpt
+++ /dev/null
@@ -1,66 +0,0 @@
---TEST--
-Bug #24499 Notice: Undefined property: stdClass::
---SKIPIF--
-<?php
-require_once('skipif.inc');
-?>
---FILE--
-<?php
-
-require_once('config.inc');
-
-$dbh = @pg_connect($conn_str);
-if (!$dbh) {
- die ("Could not connect to the server");
-}
-
-@pg_query("DROP SEQUENCE id_id_seq");
-@pg_query("DROP TABLE id");
-pg_query("CREATE TABLE id (id SERIAL, t INT)");
-
-for ($i=0; $i<4; $i++) {
- pg_query("INSERT INTO id (t) VALUES ($i)");
-}
-
-class Id
-{
- public $id;
-
- public function getId()
- {
- global $dbh;
-
- $q = pg_query($dbh, "SELECT id FROM id");
- print_r(pg_fetch_array($q));
- print_r(pg_fetch_array($q));
- $id = pg_fetch_object($q);
- var_dump($id);
- return $id->id;
- }
-}
-
-$id = new Id();
-var_dump($id->getId());
-
-pg_close($dbh);
-
-echo "Done\n";
-
-?>
---EXPECTF--
-Array
-(
- [0] => 1
- [id] => 1
-)
-Array
-(
- [0] => 2
- [id] => 2
-)
-object(stdClass)#%d (1) {
- ["id"]=>
- string(1) "3"
-}
-string(1) "3"
-Done
diff --git a/ext/pgsql/tests/80_bug27597.phpt b/ext/pgsql/tests/80_bug27597.phpt
deleted file mode 100755
index b27d6e94f0..0000000000
--- a/ext/pgsql/tests/80_bug27597.phpt
+++ /dev/null
@@ -1,60 +0,0 @@
---TEST--
-Bug #27597 pg_fetch_array not returning false
---SKIPIF--
-<?php
-require_once('skipif.inc');
-?>
---FILE--
-<?php
-
-require_once(dirname(__FILE__) . '/config.inc');
-
-$dbh = @pg_connect($conn_str);
-if (!$dbh) {
- die ("Could not connect to the server");
-}
-
-@pg_query("DROP TABLE id");
-pg_query("CREATE TABLE id (id INT)");
-
-for ($i=0; $i<4; $i++) {
- pg_query("INSERT INTO id (id) VALUES ($i)");
-}
-
-function xi_fetch_array($res, $type = PGSQL_ASSOC) {
- $a = pg_fetch_array($res, NULL, $type) ;
- return $a ;
-}
-
-$res = pg_query("SELECT * FROM id");
-$i = 0; // endless-loop protection
-while($row = xi_fetch_array($res)) {
- print_r($row);
- if ($i++ > 4) {
- echo "ENDLESS-LOOP";
- exit(1);
- }
-}
-
-pg_close($dbh);
-
-?>
-===DONE===
---EXPECTF--
-Array
-(
- [id] => 0
-)
-Array
-(
- [id] => 1
-)
-Array
-(
- [id] => 2
-)
-Array
-(
- [id] => 3
-)
-===DONE===
diff --git a/ext/pgsql/tests/80_bug32223.phpt b/ext/pgsql/tests/80_bug32223.phpt
deleted file mode 100755
index b201d320ce..0000000000
--- a/ext/pgsql/tests/80_bug32223.phpt
+++ /dev/null
@@ -1,55 +0,0 @@
---TEST--
-Bug #32223 (weird behaviour of pg_last_notice)
---SKIPIF--
-<?php
-require_once('skipif.inc');
-
-@pg_query($conn, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'");
-$res = @pg_query($conn, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
-begin
- RAISE NOTICE ''11111'';
- return ''f'';
-end;
-' LANGUAGE plpgsql;");
-if (!$res) die('skip PLPGSQL not available');
-?>
---FILE--
-<?php
-
-require_once('config.inc');
-
-$dbh = @pg_connect($conn_str);
-if (!$dbh) {
- die ("Could not connect to the server");
-}
-pg_exec($dbh, "SET LC_MESSAGES='C';");
-
-//@pg_query($dbh, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'");
-$res = pg_query($dbh, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
-begin
- RAISE NOTICE ''11111'';
- return ''f'';
-end;
-' LANGUAGE plpgsql;");
-
-
-$res = pg_query($dbh, 'SELECT test_notice()');
-$row = pg_fetch_row($res, 0);
-var_dump($row);
-pg_free_result($res);
-if ($row[0] == 'f')
-{
- var_dump(pg_last_notice($dbh));
-}
-
-pg_close($dbh);
-
-?>
-===DONE===
---EXPECTF--
-array(1) {
- [0]=>
- string(1) "f"
-}
-string(14) "NOTICE: 11111"
-===DONE===
diff --git a/ext/pgsql/tests/80_bug32223b.phpt b/ext/pgsql/tests/80_bug32223b.phpt
deleted file mode 100755
index 98e4723889..0000000000
--- a/ext/pgsql/tests/80_bug32223b.phpt
+++ /dev/null
@@ -1,57 +0,0 @@
---TEST--
-Bug #32223 (weird behaviour of pg_last_notice using define)
---SKIPIF--
-<?php
-require_once('skipif.inc');
-
-@pg_query($conn, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'");
-$res = @pg_query($conn, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
-begin
- RAISE NOTICE ''11111'';
- return ''f'';
-end;
-' LANGUAGE plpgsql;");
-if (!$res) die('skip PLPGSQL not available');
-?>
---FILE--
-<?php
-
-require_once('config.inc');
-
-define('dbh', pg_connect($conn_str));
-if (!dbh) {
- die ("Could not connect to the server");
-}
-pg_exec(dbh, "SET LC_MESSAGES='C';");
-
-//@pg_query(dbh, "CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'");
-$res = pg_query(dbh, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
-begin
- RAISE NOTICE ''11111'';
- return ''f'';
-end;
-' LANGUAGE plpgsql;");
-
-function tester() {
- $res = pg_query(dbh, 'SELECT test_notice()');
- $row = pg_fetch_row($res, 0);
- var_dump($row);
- pg_free_result($res);
- if ($row[0] == 'f')
- {
- var_dump(pg_last_notice(dbh));
- }
-}
-tester();
-
-pg_close(dbh);
-
-?>
-===DONE===
---EXPECTF--
-array(1) {
- [0]=>
- string(1) "f"
-}
-string(14) "NOTICE: 11111"
-===DONE===
diff --git a/ext/pgsql/tests/80_bug36625.phpt b/ext/pgsql/tests/80_bug36625.phpt
deleted file mode 100755
index a95cea7110..0000000000
--- a/ext/pgsql/tests/80_bug36625.phpt
+++ /dev/null
@@ -1,49 +0,0 @@
---TEST--
-Bug #36625 (pg_trace() does not work)
---SKIPIF--
-<?php
-require_once('skipif.inc');
-?>
---FILE--
-<?php
-
-require_once('config.inc');
-
-$dbh = @pg_connect($conn_str);
-if (!$dbh) {
- die ('Could not connect to the server');
-}
-
-$tracefile = dirname(__FILE__) . '/trace.tmp';
-
-@unlink($tracefile);
-var_dump(file_exists($tracefile));
-
-pg_trace($tracefile, 'w', $dbh);
-$res = pg_query($dbh, 'select 1');
-var_dump($res);
-pg_close($dbh);
-
-$found = 0;
-function search_trace_file($line)
-{
- if (strpos($line, '"select 1"') !== false || strpos($line, "'select 1'") !== false) {
- $GLOBALS['found']++;
- }
-}
-
-$trace = file($tracefile);
-array_walk($trace, 'search_trace_file');
-var_dump($found > 0);
-var_dump(file_exists($tracefile));
-
-?>
-===DONE===
---CLEAN--
-<?php unlink($tracefile); ?>
---EXPECTF--
-bool(false)
-resource(%d) of type (pgsql result)
-bool(true)
-bool(true)
-===DONE===
diff --git a/ext/pgsql/tests/98old_api.phpt b/ext/pgsql/tests/98old_api.phpt
deleted file mode 100644
index 2667e097e3..0000000000
--- a/ext/pgsql/tests/98old_api.phpt
+++ /dev/null
@@ -1,33 +0,0 @@
---TEST--
-PostgreSQL old api
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-$result = pg_exec("SELECT * FROM ".$table_name);
-pg_numrows($result);
-pg_numfields($result);
-pg_fieldname($result, 0);
-pg_fieldsize($result, $field_name);
-pg_fieldtype($result, 0);
-pg_fieldprtlen($result, 0);
-pg_fieldisnull($result, 0);
-
-pg_result($result,0,0);
-$result = pg_exec("INSERT INTO ".$table_name." VALUES (7777, 'KKK')");
-$oid = pg_getlastoid($result);
-pg_freeresult($result);
-pg_errormessage();
-$result = pg_exec("UPDATE ".$table_name." SET str = 'QQQ' WHERE str like 'RGD';");
-pg_cmdtuples($result);
-
-
-
-echo "OK";
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/9999dropdb.phpt b/ext/pgsql/tests/9999dropdb.phpt
deleted file mode 100644
index c60eeda8d6..0000000000
--- a/ext/pgsql/tests/9999dropdb.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-PostgreSQL drop db
---SKIPIF--
-<?php include("skipif.inc"); ?>
---FILE--
-<?php
-// drop test table
-
-include('config.inc');
-
-$db = pg_connect($conn_str);
-pg_query($db, "DROP TABLE ".$table_name);
-
-echo "OK";
-
-?>
---EXPECT--
-OK
diff --git a/ext/pgsql/tests/README b/ext/pgsql/tests/README
deleted file mode 100644
index 1a29a34e64..0000000000
--- a/ext/pgsql/tests/README
+++ /dev/null
@@ -1,16 +0,0 @@
-Test scripts assumes:
- - PostgreSQL server is installed locally
- - there is a PostgreSQL account for the users running the test scripts
- - there is database named "test"
-
-For instance, if your login name is 'testuser', you should have PostgreSQL
-user account named 'testuser' and grant that user access to the database
-'test'.
-
-If you have account and database, type "createdb test" from command prompt
-to create the database to execute the test scripts. By executing the above
-command as the same user running the tests you ensure that the user is
-granted access to the database.
-
-If you find problems in PostgreSQL module, please mail to
-intenals@lists.php.net, helly@php.net or yohgaki@php.net.
diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc
deleted file mode 100644
index 2b5f05a71d..0000000000
--- a/ext/pgsql/tests/config.inc
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-// These vars are used to connect db and create test table.
-// values can be set to meet your environment
-
-$conn_str = "host=localhost dbname=test"; // connection string
-$table_name = "php_pgsql_test"; // test table that should be exist
-$num_test_record = 1000; // Number of records to create
-
-$table_def = "CREATE TABLE php_pgsql_test (num int, str text, bin bytea);"; // Test table
-$field_name = "num"; // For pg_field_num()
-
-?> \ No newline at end of file
diff --git a/ext/pgsql/tests/php.gif b/ext/pgsql/tests/php.gif
deleted file mode 100644
index 7beda43fd4..0000000000
--- a/ext/pgsql/tests/php.gif
+++ /dev/null
Binary files differ
diff --git a/ext/pgsql/tests/skipif.inc b/ext/pgsql/tests/skipif.inc
deleted file mode 100644
index 043a0bd8d2..0000000000
--- a/ext/pgsql/tests/skipif.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-// This script prints "skip" unless:
-// * the pgsql extension is built-in or loadable, AND
-// * there is a database called "test" accessible
-// with no username/password, AND
-// * we have create/drop privileges on the entire "test"
-// database
-
-include("config.inc");
-
-if (!extension_loaded("pgsql")) {
- die("skip\n");
-}
-$conn = @pg_connect($conn_str);
-if (!is_resource($conn)) {
- die("skip could not connect\n");
-}
-?> \ No newline at end of file