xref: /PHP-8.2/ext/phar/tests/028.phpt (revision 74859783)
1--TEST--
2Phar::loadPhar
3--EXTENSIONS--
4phar
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
10$pname = 'phar://hio';
11$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
12$alias = '';
13
14$files = array();
15$files['a.php']   = '<?php echo "This is a\n"; include "'.$pname.'/b.php"; ?>';
16$files['b.php']   = '<?php echo "This is b\n"; include "'.$pname.'/b/c.php"; ?>';
17$files['b/c.php'] = '<?php echo "This is b/c\n"; include "'.$pname.'/b/d.php"; ?>';
18$files['b/d.php'] = '<?php echo "This is b/d\n"; include "'.$pname.'/e.php"; ?>';
19$files['e.php']   = '<?php echo "This is e\n"; ?>';
20
21include 'files/phar_test.inc';
22
23Phar::loadPhar($fname, 'hio');
24
25include $fname;
26
27echo "======\n";
28
29include $pname . '/a.php';
30
31?>
32--CLEAN--
33<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
34--EXPECT--
35This is a
36This is b
37This is b/c
38This is b/d
39This is e
40======
41This is a
42This is b
43This is b/c
44This is b/d
45This is e
46