Skip to content

Commit e5879a5

Browse files
author
Ilia Alshanetsky
committed
Fixed tests that failed in ZTS due to incorrect file paths.
Fixed test that failed due to new array dimension property being fetched.
1 parent c781690 commit e5879a5

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

ext/pgsql/tests/05large_object.phpt

+6-5
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,17 @@ pg_lo_unlink($db, (string)$oid) or print("pg_lo_unlink() error 3\n");
5555
pg_exec ($db, "commit");
5656

5757
echo "import/export LO\n";
58+
$path = dirname(__FILE__) . '/';
5859
pg_query($db, 'begin');
59-
$oid = pg_lo_import($db, 'php.gif');
60+
$oid = pg_lo_import($db, $path . 'php.gif');
6061
pg_query($db, 'commit');
6162
pg_query($db, 'begin');
62-
@unlink('php.gif.exported');
63-
pg_lo_export($oid, 'php.gif.exported', $db);
64-
if (!file_exists('php.gif.exported')) {
63+
@unlink($path . 'php.gif.exported');
64+
pg_lo_export($oid, $path . 'php.gif.exported', $db);
65+
if (!file_exists($path . 'php.gif.exported')) {
6566
echo "Export failed\n";
6667
}
67-
@unlink('php.gif.exported');
68+
@unlink($path . 'php.gif.exported');
6869
pg_query($db, 'commit');
6970

7071
echo "OK";

ext/pgsql/tests/08escape.phpt

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PostgreSQL escape functions
66
<?php
77

88
include 'config.inc';
9-
define('FILE_NAME', './php.gif');
9+
define('FILE_NAME', dirname(__FILE__) . '/php.gif');
1010

1111
// pg_escape_string() test
1212
$before = "ABC\\ABC\'";
@@ -37,8 +37,7 @@ else {
3737
}
3838

3939
// Test using database
40-
$fp = fopen(FILE_NAME,'r');
41-
$data = fread($fp, filesize(FILE_NAME));
40+
$data = file_get_contents(FILE_NAME);
4241
$db = pg_connect($conn_str);
4342

4443
// Insert binary to DB

ext/pgsql/tests/11pg_meta_data.phpt

+9-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var_dump($meta);
1717
--EXPECT--
1818
array(3) {
1919
["num"]=>
20-
array(5) {
20+
array(6) {
2121
["num"]=>
2222
int(1)
2323
["type"]=>
@@ -28,9 +28,11 @@ array(3) {
2828
bool(false)
2929
["has default"]=>
3030
bool(false)
31+
["array dims"]=>
32+
int(0)
3133
}
3234
["str"]=>
33-
array(5) {
35+
array(6) {
3436
["num"]=>
3537
int(2)
3638
["type"]=>
@@ -41,9 +43,11 @@ array(3) {
4143
bool(false)
4244
["has default"]=>
4345
bool(false)
46+
["array dims"]=>
47+
int(0)
4448
}
4549
["bin"]=>
46-
array(5) {
50+
array(6) {
4751
["num"]=>
4852
int(3)
4953
["type"]=>
@@ -54,5 +58,7 @@ array(3) {
5458
bool(false)
5559
["has default"]=>
5660
bool(false)
61+
["array dims"]=>
62+
int(0)
5763
}
5864
}

ext/pgsql/tests/18pg_escape_bytea.phpt

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ PostgreSQL pg_escape_bytea() functions
88

99
include('config.inc');
1010

11-
$fp = fopen('php.gif', 'r');
12-
$image = fread($fp, filesize('php.gif'));
11+
$image = file_get_contents(dirname(__FILE__) . '/php.gif');
1312
$esc_image = pg_escape_bytea($image);
1413

1514
$db = pg_connect($conn_str);

0 commit comments

Comments
 (0)