php-src/ext/phar/tests/014.phpt

24 lines
717 B
Plaintext
Raw Normal View History

2005-12-10 02:33:09 +00:00
--TEST--
Phar::mapPhar filesize mismatch
2005-12-10 02:33:09 +00:00
--SKIPIF--
<?php if (!extension_loaded("phar")) print "skip";?>
--INI--
phar.require_hash=0
2005-12-10 02:33:09 +00:00
--FILE--
<?php
2007-01-21 16:58:23 +00:00
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
$pname = 'phar://' . $fname;
$file = "<?php __HALT_COMPILER(); ?>";
2005-12-10 02:33:09 +00:00
// wrong crc32
$files = array();
2007-01-21 16:58:23 +00:00
$files['a'] = array('cont'=>'a', 'crc32'=>crc32('aX'));
include 'phar_test.inc';
2007-01-21 16:58:23 +00:00
echo file_get_contents($pname.'/a');
2005-12-10 02:33:09 +00:00
?>
2006-01-04 16:43:42 +00:00
--CLEAN--
<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
2005-12-10 02:33:09 +00:00
--EXPECTF--
2007-01-21 16:58:23 +00:00
Warning: file_get_contents(phar://%s/a): failed to open stream: phar error: internal corruption of phar "%s" (crc32 mismatch on file "a") in %s on line %d