Annotation of embedaddon/php/ext/phar/tests/invalid_alias.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar: set alias with invalid alias containing / \ : or ;
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: --INI--
6: phar.readonly=0
7: --FILE--
8: <?php
9: $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar';
10:
11: $p = new Phar($fname);
12: try {
13: $p->setAlias('hi/');
14: } catch (Exception $e) {
15: echo $e->getMessage() . "\n";
16: }
17: try {
18: $p->setAlias('hi\\l');
19: } catch (Exception $e) {
20: echo $e->getMessage() . "\n";
21: }
22:
23: try {
24: $p->setAlias('hil;');
25: } catch (Exception $e) {
26: echo $e->getMessage() . "\n";
27: }
28:
29: try {
30: $p->setAlias(':hil');
31: } catch (Exception $e) {
32: echo $e->getMessage() . "\n";
33: }
34: ?>
35: ===DONE===
36: --CLEAN--
37: <?php
38: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');
39: ?>
40: --EXPECTF--
41: Invalid alias "hi/" specified for phar "%sinvalid_alias.phar"
42: Invalid alias "hi\l" specified for phar "%sinvalid_alias.phar"
43: Invalid alias "hil;" specified for phar "%sinvalid_alias.phar"
44: Invalid alias ":hil" specified for phar "%sinvalid_alias.phar"
45: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>