Annotation of embedaddon/php/ext/phar/tests/029.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar::loadPhar overloading alias names
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: --INI--
6: phar.require_hash=0
7: --FILE--
8: <?php
9: $fname1 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.1.phar.php';
10: $fname2 = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.2.phar.php';
11: $fname = $fname1;
12: $alias = '';
13: $pname = 'phar://hio';
14: $file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
15:
16: $files = array();
17: $files['a.php'] = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>';
18: $files['b.php'] = '<?php echo "This is b\n"; include "'.$pname.'/b/c.php"; ?>';
19: $files['b/c.php'] = '<?php echo "This is b/c\n"; include "'.$pname.'/b/d.php"; ?>';
20: $files['b/d.php'] = '<?php echo "This is b/d\n"; include "'.$pname.'/e.php"; ?>';
21: $files['e.php'] = '<?php echo "This is e\n"; ?>';
22:
23: include 'files/phar_test.inc';
24:
25: copy($fname1, $fname2);
26:
27: var_dump(Phar::loadPhar($fname1, 'hio'));
28: var_dump(Phar::loadPhar($fname1, 'copy'));
29: $a = new Phar($fname1);
30: try
31: {
32: var_dump(Phar::loadPhar($fname2, 'copy'));
33: }
34: catch (Exception $e)
35: {
36: echo $e->getMessage() . "\n";
37: }
38:
39: ?>
40: ===DONE===
41: --CLEAN--
42: <?php
43: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.1.phar.php');
44: unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.2.phar.php');
45: ?>
46: --EXPECTF--
47: bool(true)
48: bool(true)
49: alias "copy" is already used for archive "%s029.1.phar.php" cannot be overloaded with "%s029.2.phar.php"
50: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>