add failing portion of test for compressed alias read

This commit is contained in:
Greg Beaver 2008-04-26 17:18:15 +00:00
parent 8e7f6d6662
commit 2227f10f3e

View file

@ -2,6 +2,8 @@
Phar::setAlias() zip-based Phar::setAlias() zip-based
--SKIPIF-- --SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?> <?php if (!extension_loaded("phar")) die("skip"); ?>
<?php if (!extension_loaded("zlib")) die("skip no zlib"); ?>
<?php if (!extension_loaded("bz2")) die("skip no bz2"); ?>
--INI-- --INI--
phar.require_hash=0 phar.require_hash=0
phar.readonly=0 phar.readonly=0
@ -9,6 +11,8 @@ phar.readonly=0
<?php <?php
$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip'; $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.zip';
$fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '2.phar.zip';
$fname3 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '3.phar.zip';
$phar = new Phar($fname); $phar = new Phar($fname);
$phar->setStub('<?php echo "first stub\n"; __HALT_COMPILER(); ?>'); $phar->setStub('<?php echo "first stub\n"; __HALT_COMPILER(); ?>');
@ -28,6 +32,19 @@ $phar->stopBuffering();
echo $phar->getAlias() . "\n"; echo $phar->getAlias() . "\n";
$phar->setAlias('test'); $phar->setAlias('test');
echo $phar->getAlias() . "\n"; echo $phar->getAlias() . "\n";
// test compression
$phar->compressFiles(Phar::GZ);
copy($fname, $fname2);
$phar->setAlias('unused');
$p2 = new Phar($fname2);
echo $p2->getAlias(), "\n";
$p2->compressFiles(Phar::BZ2);
copy($fname3, $fname3);
$p2->setAlias('unused2');
$p3 = new Phar($fname3);
echo $p3->getAlias(), "\n";
?> ?>
===DONE=== ===DONE===
--CLEAN-- --CLEAN--
@ -39,4 +56,6 @@ __HALT_COMPILER();
--EXPECT-- --EXPECT--
hio hio
test test
test
test
===DONE=== ===DONE===