xref: /PHP-5.3/ext/phar/tests/018.phpt (revision 228c2886)
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
10detect_unicode=0
11--FILE--
12<?php
13$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
14$pname = 'phar://' . $fname;
15$file = "<?php
16Phar::mapPhar('hio');
17__HALT_COMPILER(); ?>";
18
19$files = array();
20$files['a'] = 'a';
21$files['b/a'] = 'b';
22include 'files/phar_test.inc';
23
24include $fname;
25$dir = opendir('phar://hio/');
26while (false !== ($a = readdir($dir))) {
27	var_dump($a);
28	var_dump(is_dir('phar://hio/' . $a));
29}
30?>
31--CLEAN--
32<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
33--EXPECT--
34string(1) "a"
35bool(false)
36string(1) "b"
37bool(true)
38