]> granicus.if.org Git - php/commitdiff
fix test: don't create tmp files in "." and clean up when done
authorAntony Dovgal <tony2001@php.net>
Fri, 9 Jan 2009 23:11:52 +0000 (23:11 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 9 Jan 2009 23:11:52 +0000 (23:11 +0000)
ext/ftp/tests/ftp_get_basic.phpt

index 9e2dfb0349f1ef96b519da6dd950e0f689b2edc9..23fd8d07f3f6262fe3b92d4a9a622d0ff482bc4d 100644 (file)
@@ -1,7 +1,7 @@
 --TEST--
-FTP ftp_get file for both binary and ASCII transfer modes
+FTP ftp_get file for both binary and ASCII transfer modes 
 --CREDITS--
-Nathaniel McHugh 
+Nathaniel McHugh
 --SKIPIF--
 <?php
 require 'skipif.inc';
@@ -16,12 +16,13 @@ if (!$ftp) die("Couldn't connect to the server");
 var_dump(ftp_login($ftp, 'user', 'pass'));
 
 //test simple text transfer
-$tmpfname = tempnam(".", "ftp_test");
+$tmpfname = tempnam(dirname(__FILE__), "ftp_test");
 var_dump(ftp_get($ftp, $tmpfname ,'a story.txt', FTP_ASCII));
 echo file_get_contents($tmpfname);
+unlink($tmpfname);
 
 //test binary data transfer
-$tmpfname = tempnam(".", "ftp_test");
+$tmpfname = tempnam(dirname(__FILE__), "ftp_test");
 var_dump(ftp_get($ftp, $tmpfname, 'binary data.bin', FTP_BINARY));
 var_dump(urlencode(file_get_contents($tmpfname)));
 unlink($tmpfname);