summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/pgsql/tests/05large_object.phpt11
-rw-r--r--ext/pgsql/tests/08escape.phpt5
-rw-r--r--ext/pgsql/tests/11pg_meta_data.phpt12
-rw-r--r--ext/pgsql/tests/18pg_escape_bytea.phpt3
4 files changed, 18 insertions, 13 deletions
diff --git a/ext/pgsql/tests/05large_object.phpt b/ext/pgsql/tests/05large_object.phpt
index fe33299585..a6f30195ae 100644
--- a/ext/pgsql/tests/05large_object.phpt
+++ b/ext/pgsql/tests/05large_object.phpt
@@ -55,16 +55,17 @@ 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, 'php.gif');
+$oid = pg_lo_import($db, $path . 'php.gif');
pg_query($db, 'commit');
pg_query($db, 'begin');
-@unlink('php.gif.exported');
-pg_lo_export($oid, 'php.gif.exported', $db);
-if (!file_exists('php.gif.exported')) {
+@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('php.gif.exported');
+@unlink($path . 'php.gif.exported');
pg_query($db, 'commit');
echo "OK";
diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt
index aa24a4512e..c5a3877e37 100644
--- a/ext/pgsql/tests/08escape.phpt
+++ b/ext/pgsql/tests/08escape.phpt
@@ -6,7 +6,7 @@ PostgreSQL escape functions
<?php
include 'config.inc';
-define('FILE_NAME', './php.gif');
+define('FILE_NAME', dirname(__FILE__) . '/php.gif');
// pg_escape_string() test
$before = "ABC\\ABC\'";
@@ -37,8 +37,7 @@ else {
}
// Test using database
-$fp = fopen(FILE_NAME,'r');
-$data = fread($fp, filesize(FILE_NAME));
+$data = file_get_contents(FILE_NAME);
$db = pg_connect($conn_str);
// Insert binary to DB
diff --git a/ext/pgsql/tests/11pg_meta_data.phpt b/ext/pgsql/tests/11pg_meta_data.phpt
index 5726bb3128..a7f8ed47fc 100644
--- a/ext/pgsql/tests/11pg_meta_data.phpt
+++ b/ext/pgsql/tests/11pg_meta_data.phpt
@@ -17,7 +17,7 @@ var_dump($meta);
--EXPECT--
array(3) {
["num"]=>
- array(5) {
+ array(6) {
["num"]=>
int(1)
["type"]=>
@@ -28,9 +28,11 @@ array(3) {
bool(false)
["has default"]=>
bool(false)
+ ["array dims"]=>
+ int(0)
}
["str"]=>
- array(5) {
+ array(6) {
["num"]=>
int(2)
["type"]=>
@@ -41,9 +43,11 @@ array(3) {
bool(false)
["has default"]=>
bool(false)
+ ["array dims"]=>
+ int(0)
}
["bin"]=>
- array(5) {
+ array(6) {
["num"]=>
int(3)
["type"]=>
@@ -54,5 +58,7 @@ array(3) {
bool(false)
["has default"]=>
bool(false)
+ ["array dims"]=>
+ int(0)
}
}
diff --git a/ext/pgsql/tests/18pg_escape_bytea.phpt b/ext/pgsql/tests/18pg_escape_bytea.phpt
index 312c7e2f6b..43f98c4467 100644
--- a/ext/pgsql/tests/18pg_escape_bytea.phpt
+++ b/ext/pgsql/tests/18pg_escape_bytea.phpt
@@ -8,8 +8,7 @@ PostgreSQL pg_escape_bytea() functions
include('config.inc');
-$fp = fopen('php.gif', 'r');
-$image = fread($fp, filesize('php.gif'));
+$image = file_get_contents(dirname(__FILE__) . '/php.gif');
$esc_image = pg_escape_bytea($image);
$db = pg_connect($conn_str);