Annotation of embedaddon/php/ext/phar/tests/bug48377.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: PHP bug #48377 "error message unclear on converting phar with existing file"
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: $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.zip';
12:
13: touch($fname2);
14:
15: $phar = new Phar($fname, 0, 'a.phar');
16: $phar['x'] = 'hi';
17: try {
18: $phar->convertToData(Phar::ZIP, Phar::NONE, 'zip');
19: } catch (BadMethodCallException $e) {
20: echo $e->getMessage(),"\n";
21: }
22: ?>
23: ===DONE===
24: --CLEAN--
25: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');?>
26: <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.zip');?>
27: --EXPECTF--
28: phar "%sbug48377.zip" exists and must be unlinked prior to conversion
29: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>