xref: /php-src/ext/phar/tests/018.phpt (revision 74859783)
1--TEST--
2Phar: opendir test, root directory
3--EXTENSIONS--
4phar
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9$fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php';
10$pname = 'phar://' . $fname;
11$file = "<?php
12Phar::mapPhar('hio');
13__HALT_COMPILER(); ?>";
14
15$files = array();
16$files['a'] = 'a';
17$files['b/a'] = 'b';
18include 'files/phar_test.inc';
19
20include $fname;
21$dir = opendir('phar://hio/');
22while (false !== ($a = readdir($dir))) {
23    var_dump($a);
24    var_dump(is_dir('phar://hio/' . $a));
25}
26?>
27--CLEAN--
28<?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
29--EXPECT--
30string(1) "a"
31bool(false)
32string(1) "b"
33bool(true)
34