zoe             Thu Jan 22 22:01:05 2009 UTC

  Modified files:              
    /php-src/ext/standard/tests/file    fopen_variation16.phpt 
                                        fopen_variation12.phpt 
  Log:
  fixed tests
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fopen_variation16.phpt?r1=1.3&r2=1.4&diff_format=u
Index: php-src/ext/standard/tests/file/fopen_variation16.phpt
diff -u php-src/ext/standard/tests/file/fopen_variation16.phpt:1.3 
php-src/ext/standard/tests/file/fopen_variation16.phpt:1.4
--- php-src/ext/standard/tests/file/fopen_variation16.phpt:1.3  Wed Dec  3 
12:39:54 2008
+++ php-src/ext/standard/tests/file/fopen_variation16.phpt      Thu Jan 22 
22:01:03 2009
@@ -2,8 +2,6 @@
 Test fopen() function : variation: use include path create and read a file 
(relative)
 --CREDITS--
 Dave Kelsey <d_kel...@uk.ibm.com>
---XFAIL--
-Bug #46680
 --FILE--
 <?php
 /* Prototype  : resource fopen(string filename, string mode [, bool 
use_include_path [, resource context]])
@@ -14,7 +12,6 @@
 
 require_once('fopen_include_path.inc');
 
-echo "*** Testing fopen() : variation ***\n";
 $thisTestDir = "fopenVariation16.dir";
 mkdir($thisTestDir);
 chdir($thisTestDir);
@@ -22,6 +19,7 @@
 $newpath = create_include_path();
 set_include_path($newpath);
 runtest();
+
 $newpath = generate_next_path();
 set_include_path($newpath);
 runtest();
@@ -37,13 +35,15 @@
     $extraDir = "extraDir";
 
     mkdir($dir1.'/'.$extraDir);
+    mkdir($extraDir);
     
        $tmpfile = $extraDir.'/fopen_variation16.tmp';
+
        $h = fopen($tmpfile, "w+", true);
-       fwrite($h, "This is the test file");
+       fwrite($h, (binary) "This is the test file");
        fclose($h);
        
-       $h = fopen($dir1.'/'.$tmpfile, "r");
+       $h = @fopen($dir1.'/'.$tmpfile, "r");
        if ($h === false) {
           echo "Not created in dir1\n";
        }
@@ -57,19 +57,19 @@
           echo "could not find file for reading\n";
        }
        else {
-          echo "found file again in dir1\n";
+          echo "found file - not in dir1\n";
           fclose($h);
        }
        
-       unlink($dir1.'/'.$tmpfile);   
+       unlink($tmpfile);   
     rmdir($dir1.'/'.$extraDir);        
+    rmdir($extraDir);  
 }
 ?>
 ===DONE===
 --EXPECT--
-*** Testing fopen() : variation ***
-created in dir1
-found file again in dir1
-created in dir1
-found file again in dir1
+Not created in dir1
+found file - not in dir1
+Not created in dir1
+found file - not in dir1
 ===DONE===
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fopen_variation12.phpt?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/standard/tests/file/fopen_variation12.phpt
diff -u php-src/ext/standard/tests/file/fopen_variation12.phpt:1.2 
php-src/ext/standard/tests/file/fopen_variation12.phpt:1.3
--- php-src/ext/standard/tests/file/fopen_variation12.phpt:1.2  Wed Nov 26 
17:48:41 2008
+++ php-src/ext/standard/tests/file/fopen_variation12.phpt      Thu Jan 22 
22:01:04 2009
@@ -1,7 +1,5 @@
 --TEST--
 Test fopen() function : variation: use include path (path is bad) create a 
file (relative)
---XFAIL--
-Pending completion of Unicode streams
 --CREDITS--
 Dave Kelsey <d_kel...@uk.ibm.com>
 --FILE--
@@ -12,16 +10,15 @@
  * Alias to functions: 
  */
 
-echo "*** Testing fopen() : variation ***\n";
 set_include_path("rubbish");
 testme();
 restore_include_path();
 
 
 function testme() {
-       $tmpfile = 'fopen_variation12.tmp';
+       $tmpfile = basename(__FILE__, ".php") . ".tmp"; 
        $h = fopen($tmpfile, "w", true);
-       fwrite($h, "This is the test file");
+       fwrite($h, (binary) "This is the test file");
        fclose($h);
        
        
@@ -35,8 +32,9 @@
           unlink($tmpfile);
        }
        
+
        $scriptDirFile = dirname(__FILE__).'/'.$tmpfile; 
-       $h = fopen($scriptDirFile, "r");
+       $h = @fopen($scriptDirFile, "r");
        if ($h === false) {
           echo "Not created in script dir\n";
        }
@@ -49,7 +47,6 @@
 ?>
 ===DONE===
 --EXPECT--
-*** Testing fopen() : variation ***
-Not created in working dir
-created in script dir
+created in working dir
+Not created in script dir
 ===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to