]> granicus.if.org Git - php/commitdiff
Fixed tests that failed in ZTS due to incorrect file paths.
authorIlia Alshanetsky <iliaa@php.net>
Thu, 28 Aug 2003 00:29:44 +0000 (00:29 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 28 Aug 2003 00:29:44 +0000 (00:29 +0000)
Fixed test that failed due to new array dimension property being fetched.

ext/pgsql/tests/05large_object.phpt
ext/pgsql/tests/08escape.phpt
ext/pgsql/tests/11pg_meta_data.phpt
ext/pgsql/tests/18pg_escape_bytea.phpt

index fe33299585a763af7cf845bc97914e7ab0e3ae3a..a6f30195ae683f93ee68189ca90e16460f393c49 100644 (file)
@@ -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";
index aa24a4512ef0dfb159ca1fd0129b75832eadfe45..c5a3877e3726c10da86815b10aa759a988c98b3a 100644 (file)
@@ -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
index 5726bb3128626dab704dc469e941209a3158db74..a7f8ed47fc5e6ea42e835a1e6ed770ddb1cf3769 100644 (file)
@@ -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)
   }
 }
index 312c7e2f6b5b4d6600f4ff4de178448be3a54c38..43f98c446725cd2242c6dcdf7d6a6d7dd466e4c5 100644 (file)
@@ -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);