pajoye Thu Apr 24 08:45:35 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/file bug44805.phpt Log: - MFH: improve test and remove files on exit http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug44805.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/standard/tests/file/bug44805.phpt diff -u php-src/ext/standard/tests/file/bug44805.phpt:1.1.2.1 php-src/ext/standard/tests/file/bug44805.phpt:1.1.2.2 --- php-src/ext/standard/tests/file/bug44805.phpt:1.1.2.1 Thu Apr 24 07:45:01 2008 +++ php-src/ext/standard/tests/file/bug44805.phpt Thu Apr 24 08:45:35 2008 @@ -1,15 +1,30 @@ --TEST-- Bug#44806 (rename() function is not portable to Windows) +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die('skip.. only for Windows'); +} +?> --FILE-- <?php +$dirname = dirname(__FILE__); +$file1 = $dirname . DIRECTORY_SEPARATOR . "file1.txt"; +$file2 = $dirname . DIRECTORY_SEPARATOR . "file2.txt"; -file_put_contents("file1.txt", "this is file 1"); -file_put_contents("file2.txt", "this is file 2"); +file_put_contents($file1, "this is file 1"); +file_put_contents($file2, "this is file 2"); -rename("file1.txt", "file2.txt"); +rename($file1, $file2); echo "reading file 2: "; -readfile("file2.txt"); +readfile($file2); +if (file_exists($file1)) { + unlink($file1); +} +if (file_exists($file1)) { + unlink($file2); +} ?> --EXPECT-- reading file 2: this is file 1
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php