xref: /PHP-5.4/ext/phar/tests/phar_oo_005U.phpt (revision 377ff97a)
1--TEST--
2Phar and RecursiveDirectoryIterator
3--SKIPIF--
4<?php
5if (!extension_loaded("phar")) die("skip");
6if (!extension_loaded("spl")) die("skip SPL not available");
7if (version_compare(PHP_VERSION, "6.0", "<")) die("skip requires Unicode support");
8?>
9--INI--
10phar.require_hash=0
11--FILE--
12<?php
13
14require_once 'files/phar_oo_test.inc';
15$fname = str_replace('\\', '/', $fname);
16
17$it = new RecursiveDirectoryIterator('phar://'.$fname);
18$it = new RecursiveIteratorIterator($it);
19
20foreach($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
34unlink(dirname(__FILE__) . '/files/phar_oo_test.phar.php');
35__halt_compiler();
36?>
37--EXPECT--
38unicode(14) "phar://*/a.php"
39unicode(14) "phar://*/a.php"
40unicode(0) ""
41unicode(5) "a.php"
42unicode(5) "a.php"
43unicode(16) "phar://*/b/c.php"
44unicode(16) "phar://*/b/c.php"
45unicode(1) "b"
46unicode(7) "b/c.php"
47unicode(5) "c.php"
48unicode(16) "phar://*/b/d.php"
49unicode(16) "phar://*/b/d.php"
50unicode(1) "b"
51unicode(7) "b/d.php"
52unicode(5) "d.php"
53unicode(14) "phar://*/b.php"
54unicode(14) "phar://*/b.php"
55unicode(0) ""
56unicode(5) "b.php"
57unicode(5) "b.php"
58unicode(14) "phar://*/e.php"
59unicode(14) "phar://*/e.php"
60unicode(0) ""
61unicode(5) "e.php"
62unicode(5) "e.php"
63===DONE===
64