Annotation of embedaddon/php/ext/phar/tests/phar_oo_005_5.2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar and RecursiveDirectoryIterator
3: --SKIPIF--
4: <?php
5: if (!extension_loaded("phar")) die("skip");
6: if (!extension_loaded("spl")) die("skip SPL not available");
7: if (version_compare(PHP_VERSION, "5.3", ">")) die("skip requires 5.2 or earlier");
8: ?>
9: --INI--
10: phar.require_hash=0
11: --FILE--
12: <?php
13:
14: require_once 'files/phar_oo_test.inc';
15: $fname = str_replace('\\', '/', $fname);
16:
17: $it = new RecursiveDirectoryIterator('phar://'.$fname);
18: $it = new RecursiveIteratorIterator($it);
19:
20: foreach($it as $name => $ent)
21: {
22: var_dump(str_replace(array('\\', $fname), array('/', '*'), $name));
23: var_dump(str_replace(array('\\', $fname), array('/', '*'), $ent->getPathname()));
24: var_dump(str_replace('\\', '/', $it->getSubPath()));
25: var_dump(str_replace('\\', '/', $it->getSubPathName()));
26: $sub = $it->getPathInfo();
27: var_dump(str_replace('\\', '/', $sub->getFilename()));
28: }
29:
30: ?>
31: ===DONE===
32: --CLEAN--
33: <?php
34: unlink(dirname(__FILE__) . '/files/phar_oo_test.phar.php');
35: __halt_compiler();
36: ?>
37: --EXPECT--
38: string(14) "phar://*/a.php"
39: string(14) "phar://*/a.php"
40: string(0) ""
41: string(5) "a.php"
42: string(21) "phar_oo_test.phar.php"
43: string(16) "phar://*/b/c.php"
44: string(16) "phar://*/b/c.php"
45: string(1) "b"
46: string(7) "b/c.php"
47: string(1) "b"
48: string(16) "phar://*/b/d.php"
49: string(16) "phar://*/b/d.php"
50: string(1) "b"
51: string(7) "b/d.php"
52: string(1) "b"
53: string(14) "phar://*/b.php"
54: string(14) "phar://*/b.php"
55: string(0) ""
56: string(5) "b.php"
57: string(21) "phar_oo_test.phar.php"
58: string(14) "phar://*/e.php"
59: string(14) "phar://*/e.php"
60: string(0) ""
61: string(5) "e.php"
62: string(21) "phar_oo_test.phar.php"
63: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>