xref: /PHP-5.5/ext/phar/tests/phar_setalias.phpt (revision 16b4d8e0)
1--TEST--
2Phar::setAlias()
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.require_hash=0
7phar.readonly=0
8--FILE--
9<?php
10$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
11$pname = 'phar://' . $fname;
12$file = '<?php echo "first stub\n"; __HALT_COMPILER(); ?>';
13
14$files = array();
15$files['a'] = 'a';
16$files['b'] = 'b';
17$files['c'] = 'c';
18
19include 'files/phar_test.inc';
20
21$phar = new Phar($fname);
22echo $phar->getAlias() . "\n";
23$phar->setAlias('test');
24echo $phar->getAlias() . "\n";
25?>
26===DONE===
27--CLEAN--
28<?php
29unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
30unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phartmp.php');
31__HALT_COMPILER();
32?>
33--EXPECT--
34hio
35test
36===DONE===
37