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