summaryrefslogtreecommitdiff
path: root/ext/phar/tests/zip/corrupt_001.phpt
blob: bccbdc5990b2ac58f2229af83e6cfa0cb7339161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
Phar: corrupted zip (count mismatch)
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--FILE--
<?php
try {
    new PharData(__DIR__ . '/files/count1.zip');
} catch (Exception $e) {
    echo $e->getMessage() . "\n";
}
try {
    new PharData(__DIR__ . '/files/count2.zip');
} catch (Exception $e) {
    echo $e->getMessage() . "\n";
}
?>
--EXPECTF--
phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount1.zip"
phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount2.zip"