diff options
author | Pierre Joye <pajoye@php.net> | 2008-04-24 08:45:11 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2008-04-24 08:45:11 +0000 |
commit | 09c7d212379dfe1ae76ac48eef795804f2f3cd5d (patch) | |
tree | e7bc85963de1bd7b229544ec30ae0b8c72d4aab1 | |
parent | 937b1b7ab6a7451e846e961b4d71119dc933f275 (diff) | |
download | php-git-09c7d212379dfe1ae76ac48eef795804f2f3cd5d.tar.gz |
- improve test and remove files on exit
-rw-r--r-- | ext/standard/tests/file/bug44805.phpt | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/ext/standard/tests/file/bug44805.phpt b/ext/standard/tests/file/bug44805.phpt index 7054b76cfc..85f1255a6d 100644 --- a/ext/standard/tests/file/bug44805.phpt +++ b/ext/standard/tests/file/bug44805.phpt @@ -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 |