xref: /PHP-8.1/ext/phar/tests/phar_oo_005.phpt (revision 74859783)
1--TEST--
2Phar and RecursiveDirectoryIterator
3--EXTENSIONS--
4phar
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9
10require_once 'files/phar_oo_test.inc';
11$fname = str_replace('\\', '/', $fname);
12
13$it = new RecursiveDirectoryIterator('phar://'.$fname);
14$it = new RecursiveIteratorIterator($it);
15
16foreach($it as $name => $ent)
17{
18    var_dump(str_replace(array('\\', $fname), array('/', '*'), $name));
19    var_dump(str_replace(array('\\', $fname), array('/', '*'), $ent->getPathname()));
20    var_dump(str_replace('\\', '/', $it->getSubPath()));
21    var_dump(str_replace('\\', '/', $it->getSubPathName()));
22    $sub = $it->getPathInfo();
23    var_dump(str_replace('\\', '/', $sub->getFilename()));
24}
25
26?>
27--CLEAN--
28<?php
29unlink(__DIR__ . '/files/phar_oo_005.phar.php');
30__halt_compiler();
31?>
32--EXPECT--
33string(14) "phar://*/a.php"
34string(14) "phar://*/a.php"
35string(0) ""
36string(5) "a.php"
37string(20) "phar_oo_005.phar.php"
38string(16) "phar://*/b/c.php"
39string(16) "phar://*/b/c.php"
40string(1) "b"
41string(7) "b/c.php"
42string(1) "b"
43string(16) "phar://*/b/d.php"
44string(16) "phar://*/b/d.php"
45string(1) "b"
46string(7) "b/d.php"
47string(1) "b"
48string(14) "phar://*/b.php"
49string(14) "phar://*/b.php"
50string(0) ""
51string(5) "b.php"
52string(20) "phar_oo_005.phar.php"
53string(14) "phar://*/e.php"
54string(14) "phar://*/e.php"
55string(0) ""
56string(5) "e.php"
57string(20) "phar_oo_005.phar.php"
58