xref: /PHP-7.3/ext/phar/tests/028.phpt (revision 782352c5)
1--TEST--
2Phar::loadPhar
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9$fname = dirname(__FILE__) . '/' . 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===DONE===
33--CLEAN--
34<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
35--EXPECT--
36This is a
37This is b
38This is b/c
39This is b/d
40This is e
41======
42This is a
43This is b
44This is b/c
45This is b/d
46This is e
47===DONE===
48