Annotation of embedaddon/php/ext/standard/tests/file/bug24482.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Bug #24482 (GLOB_ONLYDIR not working)
3: --SKIPIF--
4: <?php
5: if (!function_exists("glob")) {
6: die('skip glob() not available');
7: }
8: ?>
9: --FILE--
10: <?php
1.1.1.2 ! misho 11:
! 12: // run this test in ext/standard/tests (see bug #64714)
! 13: chdir(__DIR__); // ensure in ext/standard/tests/file
! 14: chdir('..'); // move up to ext/standard/tests
! 15:
1.1 misho 16: $globdirs = glob("*", GLOB_ONLYDIR);
17:
18: $dirs = array();
19: $dh = opendir(".");
20: while (is_string($file = readdir($dh))) {
21: if ($file[0] === ".") continue;
22: if (!is_dir($file)) continue;
23: $dirs[] = $file;
24: }
25: closedir($dh);
26:
27: if (count($dirs) != count($globdirs)) {
28: echo "Directory count mismatch\n";
29:
30: echo "glob found:\n";
31: sort($globdirs);
32: var_dump($globdirs);
33:
34: echo "opendir/readdir/isdir found:\n";
35: sort($dirs);
36: var_dump($dirs);
37: } else {
38: echo "OK\n";
39: }
40: ?>
41: --EXPECT--
42: OK
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>