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