copy_variation10.phpt 792 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Test copy() function: usage variations - identical names
  3. --FILE--
  4. <?php
  5. /* Test copy(): Try copying source file to desntination file, where destination file name is identical to source name */
  6. $file_path = __DIR__;
  7. echo "*** Test copy(): Trying to create a copy of file with the same source name ***\n";
  8. $file = $file_path."/copy_variation10.tmp";
  9. $file_handle = fopen($file, "w");
  10. fwrite($file_handle, str_repeat("Hello2world...\n", 100));
  11. fclose($file_handle);
  12. var_dump( copy($file, $file) );
  13. var_dump( file_exists($file) );
  14. var_dump( filesize($file) );
  15. echo "*** Done ***\n";
  16. ?>
  17. --CLEAN--
  18. <?php
  19. unlink(__DIR__."/copy_variation10.tmp");
  20. ?>
  21. --EXPECT--
  22. *** Test copy(): Trying to create a copy of file with the same source name ***
  23. bool(false)
  24. bool(true)
  25. int(1500)
  26. *** Done ***