fileowner_variation2.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. --TEST--
  2. Test fileowner() 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 fileowner() 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( fileowner($filename) );
  26. clearstatcache();
  27. }
  28. ?>
  29. --CLEAN--
  30. <?php
  31. $file_path = __DIR__;
  32. unlink($file_path."/fileowner_variation2.tmp");
  33. ?>
  34. --EXPECTF--
  35. *** Testing Invalid file types ***
  36. Warning: fileowner(): stat failed for -2.34555 in %s on line %d
  37. bool(false)
  38. Warning: fileowner(): stat failed for in %s on line %d
  39. bool(false)
  40. bool(false)
  41. Warning: fileowner(): stat failed for 1 in %s on line %d
  42. bool(false)
  43. bool(false)
  44. Warning: fileowner(): stat failed for 1234 in %s on line %d
  45. bool(false)
  46. Warning: fileowner(): stat failed for 0 in %s on line %d
  47. bool(false)