Annotation of embedaddon/php/ext/phar/tests/phar_oo_003.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar object: entry & openFile()
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: <?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
6: --INI--
7: phar.require_hash=0
8: --FILE--
9: <?php
10:
11: require_once 'files/phar_oo_test.inc';
12:
13: $phar = new Phar($fname);
14: $phar->setInfoClass();
15: foreach($phar as $name => $ent)
16: {
17: var_dump($ent->getFilename());
18: if ($ent->isDir()) {
19: var_dump('DIR');
20: } else {
21: var_dump($ent->openFile()->fgets());
22: include $ent->getPathName();
23: }
24: }
25:
26: ?>
27: ===DONE===
28: --CLEAN--
29: <?php
30: unlink(dirname(__FILE__) . '/files/phar_oo_test.phar.php');
31: __halt_compiler();
32: ?>
33: --EXPECTF--
34: string(5) "a.php"
35: string(32) "<?php echo "This is a.php\n"; ?>"
36: This is a.php
37: string(1) "b"
38: %s(3) "DIR"
39: string(5) "b.php"
40: string(32) "<?php echo "This is b.php\n"; ?>"
41: This is b.php
42: string(5) "e.php"
43: string(32) "<?php echo "This is e.php\n"; ?>"
44: This is e.php
45: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>