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