mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
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:
parent
c78169086b
commit
e5879a5060
4 changed files with 18 additions and 13 deletions
|
@ -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";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue