bug65701.phpt 691 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Test for bug #65701: copy() doesn't work when destination filename is created by tempnam()
  3. --CREDITS--
  4. Boro Sitnikovski <buritomath@yahoo.com>
  5. --FILE--
  6. <?php
  7. $file_path = dirname(__FILE__) . "/bug65701/";
  8. @mkdir($file_path);
  9. $src = $file_path . '/srcbug65701_file.txt';
  10. $dst = tempnam($file_path, 'dstbug65701_file.txt');
  11. file_put_contents($src, "Hello World");
  12. copy($src, $dst);
  13. var_dump(filesize($dst));
  14. ?>
  15. --CLEAN--
  16. <?php
  17. $file_path = dirname(__FILE__) . "/bug65701/";
  18. foreach (scandir($file_path) as $file) {
  19. if (strpos($file, "bug65701") !== false || 'WIN' == substr(PHP_OS, 0, 3)) {
  20. unlink($file_path . $file);
  21. }
  22. }
  23. rmdir($file_path);
  24. ?>
  25. --EXPECT--
  26. int(11)