xref: /PHP-5.3/ext/phar/tests/008.phpt (revision 228c2886)
1--TEST--
2Phar::mapPhar truncated manifest (not enough for manifest length)
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip");?>
5--INI--
6detect_unicode=0
7--FILE--
8<?php
9$file = "<?php
10Phar::mapPhar('hio');
11__HALT_COMPILER(); ?>";
12$file .= pack('V', 500) . 'notenough';
13file_put_contents(dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php', $file);
14try {
15include dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
16} catch (Exception $e) {
17echo $e->getMessage();
18}
19?>
20--CLEAN--
21<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
22--EXPECTF--
23internal corruption of phar "%s" (truncated manifest header)
24