diff options
author | Boro Sitnikovski <buritomath@yahoo.com> | 2014-04-14 10:02:11 +0200 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2014-04-20 15:22:44 -0700 |
commit | a18cec1b865994735e5b4ab757ccc1a14f8607ff (patch) | |
tree | 28428bd1f1eee19c3d62a1221a840845eb759696 /ext/standard/tests | |
parent | 53c68811bae5f81047d101f9dc79532d89eed363 (diff) | |
download | php-git-a18cec1b865994735e5b4ab757ccc1a14f8607ff.tar.gz |
Fix bug #65701: Do not use cache for file file copy
Diffstat (limited to 'ext/standard/tests')
-rw-r--r-- | ext/standard/tests/file/bug65701.phpt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ext/standard/tests/file/bug65701.phpt b/ext/standard/tests/file/bug65701.phpt new file mode 100644 index 0000000000..2b1b5d491d --- /dev/null +++ b/ext/standard/tests/file/bug65701.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test for bug #65701: copy() doesn't work when destination filename is created by tempnam() +--CREDITS-- +Boro Sitnikovski <buritomath@yahoo.com> +--FILE-- +<?php +$file_path = dirname(__FILE__) . "/bug65701/"; + +mkdir($file_path); + +$src = $file_path . '/srcbug65701_file.txt'; +$dst = tempnam($file_path, 'dstbug65701_file.txt'); + +file_put_contents($src, "Hello World"); + +copy($src, $dst); +var_dump(filesize($dst)); +?> +--CLEAN-- +<?php +$file_path = dirname(__FILE__) . "/bug65701/"; +foreach (scandir($file_path) as $file) { + if (strpos($file, "bug65701") !== false) { + unlink($file_path . $file); + } +} +rmdir($file_path); +?> +--EXPECT-- +int(11) |