mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
add failing portion of test for compressed alias read
This commit is contained in:
parent
8e7f6d6662
commit
2227f10f3e
1 changed files with 19 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
Phar::setAlias() zip-based
|
||||
--SKIPIF--
|
||||
<?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--
|
||||
phar.require_hash=0
|
||||
phar.readonly=0
|
||||
|
@ -9,6 +11,8 @@ phar.readonly=0
|
|||
<?php
|
||||
|
||||
$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->setStub('<?php echo "first stub\n"; __HALT_COMPILER(); ?>');
|
||||
|
@ -28,6 +32,19 @@ $phar->stopBuffering();
|
|||
echo $phar->getAlias() . "\n";
|
||||
$phar->setAlias('test');
|
||||
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===
|
||||
--CLEAN--
|
||||
|
@ -39,4 +56,6 @@ __HALT_COMPILER();
|
|||
--EXPECT--
|
||||
hio
|
||||
test
|
||||
test
|
||||
test
|
||||
===DONE===
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue