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