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