Annotation of embedaddon/php/ext/standard/tests/file/bug44805.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug#44806 (rename() function is not portable to Windows)
! 3: --SKIPIF--
! 4: <?php
! 5: if (substr(PHP_OS, 0, 3) != 'WIN') {
! 6: die('skip.. only for Windows');
! 7: }
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: $dirname = dirname(__FILE__);
! 12: $file1 = $dirname . DIRECTORY_SEPARATOR . "file1.txt";
! 13: $file2 = $dirname . DIRECTORY_SEPARATOR . "file2.txt";
! 14:
! 15: file_put_contents($file1, "this is file 1");
! 16: file_put_contents($file2, "this is file 2");
! 17:
! 18: rename($file1, $file2);
! 19:
! 20: echo "reading file 2: ";
! 21: readfile($file2);
! 22: if (file_exists($file1)) {
! 23: unlink($file1);
! 24: }
! 25: if (file_exists($file1)) {
! 26: unlink($file2);
! 27: }
! 28: ?>
! 29: --EXPECT--
! 30: reading file 2: this is file 1
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>