fnmatch_basic.phpt 912 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. Test fnmatch() function: Basic functionality
  3. --SKIPIF--
  4. <?php
  5. if (!function_exists('fnmatch'))
  6. die("skip fnmatch() function is not available");
  7. ?>
  8. --FILE--
  9. <?php
  10. echo "*** Testing fnmatch() with file ***\n";
  11. $file = basename(__FILE__);
  12. var_dump( fnmatch("*.php", $file) );
  13. var_dump( fnmatch("*.p*p", $file) );
  14. var_dump( fnmatch("*.p*", $file) );
  15. var_dump( fnmatch("*", $file) );
  16. var_dump( fnmatch("**", $file) );
  17. var_dump( fnmatch("*.phpt", $file) );
  18. echo "*** Testing fnmatch() with other than file ***\n";
  19. var_dump( fnmatch(100, 100) );
  20. var_dump( fnmatch("string", "string") );
  21. var_dump( fnmatch(TRUE, TRUE) );
  22. var_dump( fnmatch(FALSE, FALSE) );
  23. echo "\n*** Done ***\n";
  24. ?>
  25. --EXPECT--
  26. *** Testing fnmatch() with file ***
  27. bool(true)
  28. bool(true)
  29. bool(true)
  30. bool(true)
  31. bool(true)
  32. bool(false)
  33. *** Testing fnmatch() with other than file ***
  34. bool(true)
  35. bool(true)
  36. bool(true)
  37. bool(true)
  38. *** Done ***