xref: /PHP-7.4/ext/phar/tests/026.phpt (revision 26dfce7f)
1--TEST--
2Phar: phar:// require from within
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
10$pname = 'phar://' . $fname;
11$file = "<?php __HALT_COMPILER(); ?>";
12
13$files = array();
14$files['a.php']   = '<?php echo "This is a\n"; require \''.$pname.'/b.php\'; ?>';
15$files['b.php']   = '<?php echo "This is b\n"; require \''.$pname.'/b/c.php\'; ?>';
16$files['b/c.php'] = '<?php echo "This is b/c\n"; require \''.$pname.'/b/d.php\'; ?>';
17$files['b/d.php'] = '<?php echo "This is b/d\n"; require \''.$pname.'/e.php\'; ?>';
18$files['e.php']   = '<?php echo "This is e\n"; ?>';
19
20include 'files/phar_test.inc';
21
22require $pname . '/a.php';
23
24?>
25===DONE===
26--CLEAN--
27<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
28--EXPECT--
29This is a
30This is b
31This is b/c
32This is b/d
33This is e
34===DONE===
35