xref: /PHP-8.0/ext/phar/tests/zip/badalias.phpt (revision 9f96b2bd)
1--TEST--
2Phar: invalid aliases
3--INI--
4phar.require_hash=0
5--SKIPIF--
6<?php if (!extension_loaded("phar")) die("skip"); ?>
7<?php if (!extension_loaded("zlib")) die("skip no zlib"); ?>
8<?php if (!extension_loaded("bz2")) die("skip no bz2"); ?>
9--FILE--
10<?php
11$e = __DIR__ . '/files/';
12for ($i = 1; $i <= 5; $i++) {
13try {
14new Phar($e . "badalias$i.phar.zip");
15} catch (Exception $ee) {
16echo $ee->getMessage(), "\n";
17}
18}
19?>
20--EXPECTF--
21phar error: invalid alias "hi/there" in zip-based phar "%sbadalias1.phar.zip"
22phar error: invalid alias "hi\there" in zip-based phar "%sbadalias2.phar.zip"
23phar error: invalid alias "hi\there" in zip-based phar "%sbadalias3.phar.zip"
24phar error: invalid alias "hi;there" in zip-based phar "%sbadalias4.phar.zip"
25phar error: invalid alias "hi:there" in zip-based phar "%sbadalias5.phar.zip"
26