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

24 lines
726 B
Plaintext
Raw Normal View History

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