xref: /PHP-8.4/ext/phar/tests/011.phpt (revision 74859783)
1--TEST--
2Phar::mapPhar filesize too small in manifest
3--EXTENSIONS--
4phar
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
10$pname = 'phar://' . $fname;
11$file = "<?php
12Phar::mapPhar('hio');
13__HALT_COMPILER(); ?>";
14
15// compressed file length does not match incompressed length for an uncompressed file
16
17$files = array();
18$files['a'] = array('cont'=>'a','ulen'=>1,'clen'=>2);
19include 'files/phar_test.inc';
20try {
21include $fname;
22echo file_get_contents('phar://hio/a');
23} catch (Exception $e) {
24echo $e->getMessage();
25}
26?>
27--CLEAN--
28<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
29--EXPECTF--
30internal corruption of phar "%s" (compressed and uncompressed size does not match for uncompressed entry)
31