1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00
Files
archived-php-src/ext/phar/tests/bug48377.2.phpt
T
Mitch Hagstrand a9fdf3d6b4 Fix for Bug 74196: PharData->decompress() does not correctly support dot names
1. Fixed phar_rename_archive to no longer remove everything after a "." in the filename
2. Removed unused "zend_bool compress" parameter
3. Added Test
4. Fixed tests that had a work around for this problem
2017-04-10 06:43:26 +01:00

26 lines
675 B
PHP

--TEST--
Phar: PHP bug #48377 "error message unclear on converting phar with existing file" test #2
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--INI--
phar.require_hash=0
phar.readonly=0
--FILE--
<?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.zip';
$phar = new PharData($fname);
$phar['x'] = 'hi';
try {
$phar->convertToData(Phar::ZIP, Phar::NONE, 'phar.zip');
} catch (BadMethodCallException $e) {
echo $e->getMessage(),"\n";
}
?>
===DONE===
--CLEAN--
<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.zip');?>
--EXPECTF--
data phar "%sbug48377.2.phar.zip" has invalid extension phar.zip
===DONE===