2007-05-25 13:44:23 +00:00
|
|
|
--TEST--
|
|
|
|
Test fnmatch() function: Basic functionality
|
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
2008-10-21 13:38:18 +00:00
|
|
|
if (!function_exists('fnmatch'))
|
|
|
|
die("skip fnmatch() function is not available");
|
2007-08-29 10:11:40 +00:00
|
|
|
?>
|
2007-05-25 13:44:23 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
/* Prototype: bool fnmatch ( string $pattern, string $string [, int $flags] )
|
|
|
|
Description: fnmatch() checks if the passed string would match
|
|
|
|
the given shell wildcard pattern.
|
|
|
|
*/
|
|
|
|
|
|
|
|
echo "*** Testing fnmatch() with file ***\n";
|
|
|
|
$file = basename(__FILE__);
|
|
|
|
|
|
|
|
var_dump( fnmatch("*.php", $file) );
|
|
|
|
var_dump( fnmatch("*.p*p", $file) );
|
|
|
|
var_dump( fnmatch("*.p*", $file) );
|
|
|
|
var_dump( fnmatch("*", $file) );
|
|
|
|
var_dump( fnmatch("**", $file) );
|
|
|
|
var_dump( fnmatch("*.phpt", $file) );
|
|
|
|
|
|
|
|
echo "*** Testing fnmatch() with other than file ***\n";
|
|
|
|
var_dump( fnmatch(100, 100) );
|
|
|
|
var_dump( fnmatch("string", "string") );
|
|
|
|
var_dump( fnmatch(TRUE, TRUE) );
|
|
|
|
var_dump( fnmatch(FALSE, FALSE) );
|
|
|
|
var_dump( fnmatch(NULL, NULL) );
|
|
|
|
|
|
|
|
echo "\n*** Done ***\n";
|
|
|
|
?>
|
2009-01-20 01:40:06 +00:00
|
|
|
--EXPECT--
|
2007-05-25 13:44:23 +00:00
|
|
|
*** Testing fnmatch() with file ***
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
bool(false)
|
|
|
|
*** Testing fnmatch() with other than file ***
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
|
|
|
|
*** Done ***
|