Annotation of embedaddon/php/ext/phar/tests/bug47085.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: PHP bug #47085: "rename() returns true even if the file in PHAR does not exist"
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: --INI--
6: phar.require_hash=0
7: phar.readonly=0
8: --FILE--
9: <?php
10: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
11:
12: $phar = new Phar($fname, 0, 'a.phar');
13: $phar['x'] = 'hi';
14: unset($phar);
15: rename("phar://a.phar/x", "phar://a.phar/y");
16: var_dump(rename("phar://a.phar/x", "phar://a.phar/y"));
17: ?>
18: ===DONE===
19: --CLEAN--
20: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');?>
21: --EXPECTF--
22: Warning: rename(): phar error: cannot rename "phar://a.phar/x" to "phar://a.phar/y" from extracted phar archive, source does not exist in %sbug47085.php on line %d
23: bool(false)
24: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>