Fixed tests that failed in ZTS due to incorrect file paths.

Fixed test that failed due to new array dimension property being fetched.
This commit is contained in:
Ilia Alshanetsky 2003-08-28 00:29:44 +00:00
parent c78169086b
commit e5879a5060
4 changed files with 18 additions and 13 deletions

View file

@ -55,16 +55,17 @@ pg_lo_unlink($db, (string)$oid) or print("pg_lo_unlink() error 3\n");
pg_exec ($db, "commit"); pg_exec ($db, "commit");
echo "import/export LO\n"; echo "import/export LO\n";
$path = dirname(__FILE__) . '/';
pg_query($db, 'begin'); 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, 'commit');
pg_query($db, 'begin'); pg_query($db, 'begin');
@unlink('php.gif.exported'); @unlink($path . 'php.gif.exported');
pg_lo_export($oid, 'php.gif.exported', $db); pg_lo_export($oid, $path . 'php.gif.exported', $db);
if (!file_exists('php.gif.exported')) { if (!file_exists($path . 'php.gif.exported')) {
echo "Export failed\n"; echo "Export failed\n";
} }
@unlink('php.gif.exported'); @unlink($path . 'php.gif.exported');
pg_query($db, 'commit'); pg_query($db, 'commit');
echo "OK"; echo "OK";

View file

@ -6,7 +6,7 @@ PostgreSQL escape functions
<?php <?php
include 'config.inc'; include 'config.inc';
define('FILE_NAME', './php.gif'); define('FILE_NAME', dirname(__FILE__) . '/php.gif');
// pg_escape_string() test // pg_escape_string() test
$before = "ABC\\ABC\'"; $before = "ABC\\ABC\'";
@ -37,8 +37,7 @@ else {
} }
// Test using database // Test using database
$fp = fopen(FILE_NAME,'r'); $data = file_get_contents(FILE_NAME);
$data = fread($fp, filesize(FILE_NAME));
$db = pg_connect($conn_str); $db = pg_connect($conn_str);
// Insert binary to DB // Insert binary to DB

View file

@ -17,7 +17,7 @@ var_dump($meta);
--EXPECT-- --EXPECT--
array(3) { array(3) {
["num"]=> ["num"]=>
array(5) { array(6) {
["num"]=> ["num"]=>
int(1) int(1)
["type"]=> ["type"]=>
@ -28,9 +28,11 @@ array(3) {
bool(false) bool(false)
["has default"]=> ["has default"]=>
bool(false) bool(false)
["array dims"]=>
int(0)
} }
["str"]=> ["str"]=>
array(5) { array(6) {
["num"]=> ["num"]=>
int(2) int(2)
["type"]=> ["type"]=>
@ -41,9 +43,11 @@ array(3) {
bool(false) bool(false)
["has default"]=> ["has default"]=>
bool(false) bool(false)
["array dims"]=>
int(0)
} }
["bin"]=> ["bin"]=>
array(5) { array(6) {
["num"]=> ["num"]=>
int(3) int(3)
["type"]=> ["type"]=>
@ -54,5 +58,7 @@ array(3) {
bool(false) bool(false)
["has default"]=> ["has default"]=>
bool(false) bool(false)
["array dims"]=>
int(0)
} }
} }

View file

@ -8,8 +8,7 @@ PostgreSQL pg_escape_bytea() functions
include('config.inc'); include('config.inc');
$fp = fopen('php.gif', 'r'); $image = file_get_contents(dirname(__FILE__) . '/php.gif');
$image = fread($fp, filesize('php.gif'));
$esc_image = pg_escape_bytea($image); $esc_image = pg_escape_bytea($image);
$db = pg_connect($conn_str); $db = pg_connect($conn_str);