xref: /PHP-5.3/ext/phar/tests/bug48377.2.phpt (revision 115e370d)
1--TEST--
2Phar: PHP bug #48377 "error message unclear on converting phar with existing file" test #2
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.require_hash=0
7phar.readonly=0
8--FILE--
9<?php
10$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.zip';
11
12$phar = new PharData($fname);
13$phar['x'] = 'hi';
14try {
15	$phar->convertToData(Phar::ZIP, Phar::NONE, '.2.phar.zip');
16} catch (BadMethodCallException $e) {
17	echo $e->getMessage(),"\n";
18}
19?>
20===DONE===
21--CLEAN--
22<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.zip');?>
23--EXPECTF--
24data phar "%sbug48377.2.phar.zip" has invalid extension 2.phar.zip
25===DONE===