xref: /PHP-7.0/ext/phar/tests/019.phpt (revision 377ff97a)
1--TEST--
2Phar: opendir test, subdirectory
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--INI--
6phar.require_hash=0
7--FILE--
8<?php
9
10$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
11$pname = 'phar://' . $fname;
12$file = b"<?php
13Phar::mapPhar('hio');
14__HALT_COMPILER(); ?>";
15
16$files = array();
17$files['a'] = 'a';
18$files['b/a'] = 'b';
19$files['b/c/d'] = 'c';
20$files['bad/c'] = 'd';
21
22include 'files/phar_test.inc';
23include $fname;
24
25$dir = opendir('phar://hio/b');
26
27if ($dir) {
28	while (false !== ($a = readdir($dir))) {
29		var_dump($a);
30		var_dump(is_dir('phar://hio/b/' . $a));
31	}
32}
33
34?>
35--CLEAN--
36<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
37--EXPECTF--
38%s(1) "a"
39bool(false)
40%s(1) "c"
41bool(true)
42