From 3db4fe36a46c493d9594758a202d824ece1b555f Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Tue, 25 Aug 2009 00:14:23 +0000 Subject: [PATCH] - fix test --- .../tests/file/unlink_variation9-win32.phpt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ext/standard/tests/file/unlink_variation9-win32.phpt b/ext/standard/tests/file/unlink_variation9-win32.phpt index 4f1a8bb8d3..acc2ce6a83 100644 --- a/ext/standard/tests/file/unlink_variation9-win32.phpt +++ b/ext/standard/tests/file/unlink_variation9-win32.phpt @@ -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-- @@ -117,4 +114,4 @@ file removed file removed -- removing /%s/unlinkVar9.tmp/file.tmp -- file removed -===DONE=== \ No newline at end of file +===DONE=== -- 2.49.0