Annotation of embedaddon/php/ext/phar/tests/phar_oo_002U.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar object: iterator & entries
3: --SKIPIF--
4: <?php
5: if (!extension_loaded("phar")) die("skip");
6: if (version_compare(PHP_VERSION, "6.0", "<")) die("skip requires Unicode support");
7: if (!extension_loaded("spl")) die("skip SPL not available");
8: ?>
9: --INI--
10: phar.readonly=1
11: phar.require_hash=0
12: --FILE--
13: <?php
14:
15: require_once 'files/phar_oo_test.inc';
16:
17: $phar = new Phar($fname);
18: $phar->setInfoClass('SplFileInfo');
19: foreach($phar as $name => $ent)
20: {
21: var_dump(str_replace(str_replace('\\', '/', dirname(__FILE__)), '*', $name));
22: var_dump($ent->getFilename());
23: var_dump($ent->getSize());
24: var_dump($ent->getType());
25: var_dump($ent->isWritable());
26: var_dump($ent->isReadable());
27: var_dump($ent->isExecutable());
28: var_dump($ent->isFile());
29: var_dump($ent->isDir());
30: var_dump($ent->isLink());
31: var_dump($ent->getCTime());
32: var_dump($ent->getMTime());
33: var_dump($ent->getATime());
34: }
35:
36: echo "==RECURSIVE==\n";
37:
38: $phar = new Phar($fname);
39: foreach(new RecursiveIteratorIterator($phar) as $name => $ent)
40: {
41: var_dump(str_replace(str_replace('\\', '/', dirname(__FILE__)), '*', $name));
42: var_dump(str_replace('\\', '/', $ent->getFilename()));
43: var_dump($ent->getCompressedSize());
44: var_dump($ent->isCRCChecked());
45: var_dump($ent->isCRCChecked() ? $ent->getCRC32() : NULL);
46: var_dump($ent->getPharFlags());
47: }
48:
49: ?>
50: ===DONE===
51: --CLEAN--
52: <?php
53: unlink(dirname(__FILE__) . '/files/phar_oo_test.phar.php');
54: __halt_compiler();
55: ?>
56: --EXPECTF--
57: unicode(42) "phar://*/files/phar_oo_test.phar.php%ca.php"
58: string(5) "a.php"
59: int(32)
60: unicode(4) "file"
61: bool(false)
62: bool(true)
63: bool(false)
64: bool(true)
65: bool(false)
66: bool(false)
67: int(%d)
68: int(%d)
69: int(%d)
70: unicode(38) "phar://*/files/phar_oo_test.phar.php%cb"
71: string(1) "b"
72: int(0)
73: unicode(3) "dir"
74: bool(false)
75: bool(true)
76: bool(false)
77: bool(false)
78: bool(true)
79: bool(false)
80: int(%d)
81: int(%d)
82: int(%d)
83: unicode(42) "phar://*/files/phar_oo_test.phar.php%cb.php"
84: string(5) "b.php"
85: int(32)
86: unicode(4) "file"
87: bool(false)
88: bool(true)
89: bool(false)
90: bool(true)
91: bool(false)
92: bool(false)
93: int(%d)
94: int(%d)
95: int(%d)
96: unicode(42) "phar://*/files/phar_oo_test.phar.php%ce.php"
97: string(5) "e.php"
98: int(32)
99: unicode(4) "file"
100: bool(false)
101: bool(true)
102: bool(false)
103: bool(true)
104: bool(false)
105: bool(false)
106: int(%d)
107: int(%d)
108: int(%d)
109: ==RECURSIVE==
110: unicode(42) "phar://*/files/phar_oo_test.phar.php%ca.php"
111: unicode(5) "a.php"
112: int(32)
113: bool(false)
114: NULL
115: int(0)
116: unicode(44) "phar://*/files/phar_oo_test.phar.php/b%cc.php"
117: unicode(5) "c.php"
118: int(34)
119: bool(false)
120: NULL
121: int(0)
122: unicode(44) "phar://*/files/phar_oo_test.phar.php/b%cd.php"
123: unicode(5) "d.php"
124: int(34)
125: bool(false)
126: NULL
127: int(0)
128: unicode(42) "phar://*/files/phar_oo_test.phar.php%cb.php"
129: unicode(5) "b.php"
130: int(32)
131: bool(false)
132: NULL
133: int(0)
134: unicode(42) "phar://*/files/phar_oo_test.phar.php%ce.php"
135: unicode(5) "e.php"
136: int(32)
137: bool(false)
138: NULL
139: int(0)
140: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>