Annotation of embedaddon/php/ext/standard/tests/file/bug65701.phpt, revision 1.1

1.1     ! misho       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: 
        !             9: mkdir($file_path);
        !            10: 
        !            11: $src = $file_path . '/srcbug65701_file.txt';
        !            12: $dst = tempnam($file_path, 'dstbug65701_file.txt');
        !            13: 
        !            14: file_put_contents($src, "Hello World");
        !            15: 
        !            16: copy($src, $dst);
        !            17: var_dump(filesize($dst));
        !            18: ?>
        !            19: --CLEAN--
        !            20: <?php
        !            21: $file_path = dirname(__FILE__) . "/bug65701/";
        !            22: foreach (scandir($file_path) as $file) {
        !            23:     if (strpos($file, "bug65701") !== false) {
        !            24:         unlink($file_path . $file);
        !            25:     }
        !            26: }
        !            27: rmdir($file_path);
        !            28: ?>
        !            29: --EXPECT--
        !            30: int(11)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>