xref: /PHP-7.4/ext/phar/tests/phar_setalias.phpt (revision 26dfce7f)
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 = __DIR__ . '/' . 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(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
30unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phartmp.php');
31__HALT_COMPILER();
32?>
33--EXPECT--
34hio
35test
36===DONE===
37