mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
new test for zip archives with files created from stdin
This commit is contained in:
parent
78c55d2f6d
commit
0d1e0b4311
17
ext/phar/tests/zip/corrupt_006.phpt
Normal file
17
ext/phar/tests/zip/corrupt_006.phpt
Normal file
@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Phar: zip with file created from stdin
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("phar")) die("skip"); ?>
|
||||
<?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
new PharData(dirname(__FILE__) . '/files/stdin.zip');
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage() . "\n";
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
phar error: Cannot process zips created from stdin (zero-length filename) in zip-based phar "%sstdin.zip"
|
||||
===DONE===
|
@ -4,4 +4,8 @@ $a = new corrupt_zipmaker;
|
||||
$a->addFile('hi', null, 'hii');
|
||||
$a->addFile('hi2', null, 'hii2', null, null, 'encrypt', 'encrypt');
|
||||
$a->writeZip(dirname(__FILE__) . '/encrypted.zip');
|
||||
$a = new corrupt_zipmaker;
|
||||
$a->addFile('hi', null, 'hii');
|
||||
$a->addFile('', null, 'stdin');
|
||||
$a->writeZip(dirname(__FILE__) . '/stdin.zip');
|
||||
?>
|
||||
|
Binary file not shown.
BIN
ext/phar/tests/zip/files/stdin.zip
Normal file
BIN
ext/phar/tests/zip/files/stdin.zip
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user