diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/standard/tests/file/fnmatch_basic.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/standard/tests/file/fnmatch_basic.phpt')
-rw-r--r-- | ext/standard/tests/file/fnmatch_basic.phpt | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/ext/standard/tests/file/fnmatch_basic.phpt b/ext/standard/tests/file/fnmatch_basic.phpt new file mode 100644 index 0000000..1896051 --- /dev/null +++ b/ext/standard/tests/file/fnmatch_basic.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test fnmatch() function: Basic functionality +--SKIPIF-- +<?php +if (!function_exists('fnmatch')) + die("skip fnmatch() function is not available"); +?> +--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"; +?> +--EXPECT-- +*** 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 *** |