]> granicus.if.org Git - php/commitdiff
- fix test
authorPierre Joye <pajoye@php.net>
Tue, 25 Aug 2009 00:14:23 +0000 (00:14 +0000)
committerPierre Joye <pajoye@php.net>
Tue, 25 Aug 2009 00:14:23 +0000 (00:14 +0000)
ext/standard/tests/file/unlink_variation9-win32.phpt

index 4f1a8bb8d3dd81800a09ee2959f6060edc8b2539..afbfe0665fb1f7a3507d3995cd120e4643afae12 100644 (file)
@@ -20,8 +20,9 @@ echo "*** Testing unlink() : variation ***\n";
 
 $workDir = "unlinkVar9.tmp";
 $tmpFile = "file.tmp";
+chdir(__DIR__);
 mkdir($workDir);
-$cwd = getcwd();
+$cwd = __DIR__;
 $unixifiedFile = '/'.substr(str_replace('\\','/',$cwd).'/'.$workDir.'/'.$tmpFile, 3);
 
 $files = array(
@@ -57,12 +58,8 @@ $files = array(
              
 
 foreach($files as $fileToUnlink) {
-   test_realfile($workDir.'/'.$tmpFile, $fileToUnlink);
-}
-
-rmdir($workDir);
-
-function test_realfile($file, $tounlink) {
+       $file = $workDir.'/'.$tmpFile;
+       $tounlink = $fileToUnlink;
    touch($file);
    echo "-- removing $tounlink --\n";           
    $res = unlink($tounlink);
@@ -79,7 +76,7 @@ function test_realfile($file, $tounlink) {
    }
 }
 
-
+rmdir($workDir);
 ?>
 ===DONE===
 --EXPECTF--