filegroup_variation2.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --TEST--
  2. Test filegroup() function: usage variations - invalid filenames
  3. --CREDITS--
  4. Dave Kelsey <d_kelsey@uk.ibm.com>
  5. --CONFLICTS--
  6. obscure_filename
  7. --FILE--
  8. <?php
  9. /* Testing filegroup() with invalid arguments -int, float, bool, NULL, resource */
  10. $file_path = __DIR__;
  11. echo "*** Testing Invalid file types ***\n";
  12. $filenames = array(
  13. /* Invalid filenames */
  14. -2.34555,
  15. " ",
  16. "",
  17. TRUE,
  18. FALSE,
  19. /* scalars */
  20. 1234,
  21. 0
  22. );
  23. /* loop through to test each element the above array */
  24. foreach( $filenames as $filename ) {
  25. var_dump( filegroup($filename) );
  26. clearstatcache();
  27. }
  28. ?>
  29. --CLEAN--
  30. <?php
  31. $file_path = __DIR__;
  32. unlink($file_path."/filegroup_variation2.tmp");
  33. ?>
  34. --EXPECTF--
  35. *** Testing Invalid file types ***
  36. Warning: filegroup(): stat failed for -2.34555 in %s on line %d
  37. bool(false)
  38. Warning: filegroup(): stat failed for in %s on line %d
  39. bool(false)
  40. bool(false)
  41. Warning: filegroup(): stat failed for 1 in %s on line %d
  42. bool(false)
  43. bool(false)
  44. Warning: filegroup(): stat failed for 1234 in %s on line %d
  45. bool(false)
  46. Warning: filegroup(): stat failed for 0 in %s on line %d
  47. bool(false)