xref: /PHP-8.0/ext/phar/tests/zip/corrupt_001.phpt (revision f8d79582)
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(__DIR__ . '/files/count1.zip');
9} catch (Exception $e) {
10    echo $e->getMessage() . "\n";
11}
12try {
13    new PharData(__DIR__ . '/files/count2.zip');
14} catch (Exception $e) {
15    echo $e->getMessage() . "\n";
16}
17?>
18--EXPECTF--
19phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount1.zip"
20phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount2.zip"
21