]> granicus.if.org Git - php/commitdiff
regression test for #24482 GLOB_ONLYDIR is not working (on BSD)
authorHartmut Holzgraefe <hholzgra@php.net>
Fri, 4 Jul 2003 14:38:07 +0000 (14:38 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Fri, 4 Jul 2003 14:38:07 +0000 (14:38 +0000)
ext/standard/tests/file/bug24482.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/file/bug24482.phpt b/ext/standard/tests/file/bug24482.phpt
new file mode 100644 (file)
index 0000000..a10da99
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+Bug #24482: GLOB_ONLYDIR not working
+--FILE--
+<?php
+$globdirs = glob("*", GLOB_ONLYDIR);
+
+$dirs = array();
+$dh = opendir(".");
+while (is_string($file = readdir($dh))) {
+       if ($file{0} === ".") continue;
+       if (!is_dir($file)) continue;
+       $dirs[] = $file;
+}
+closedir($dh);
+
+if (count($dirs) != count($globdirs)) {
+       echo "Directory count mismatch\n";
+       
+       echo "glob found:\n";
+       sort($globdirs);        
+       var_dump($globdirs);
+       
+       echo "opendir/readdir/isdir found:\n";
+       sort($dirs);    
+       var_dump($dirs);
+} else {
+       echo "OK\n";
+}
+?>
+--EXPECT--
+OK