xref: /PHP-8.2/ext/phar/tests/phar_setalias.phpt (revision 98d004c9)
1--TEST--
2Phar::setAlias()
3--EXTENSIONS--
4phar
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--CLEAN--
27<?php
28unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php');
29?>
30--EXPECT--
31hio
32test
33