File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / file / bug24482.phpt
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:06 2013 UTC (11 years ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
Bug #24482 (GLOB_ONLYDIR not working)
--SKIPIF--
<?php
if (!function_exists("glob")) {
    die('skip glob() not available');
}
?>
--FILE--
<?php

// run this test in ext/standard/tests (see bug #64714)
chdir(__DIR__); // ensure in ext/standard/tests/file
chdir('..'); // move up to ext/standard/tests

$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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>