posix_setuid_variation2.phpt 810 B

12345678910111213141516171819202122232425262728293031323334353637
  1. --TEST--
  2. Test function posix_setuid() by substituting argument 1 with boolean values.
  3. --SKIPIF--
  4. <?php
  5. if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
  6. if(posix_geteuid() == 0) print "skip - Cannot run test as root.";
  7. ?>
  8. --CREDITS--
  9. Marco Fabbri mrfabbri@gmail.com
  10. Francesco Fullone ff@ideato.it
  11. #PHPTestFest Cesena Italia on 2009-06-20
  12. --FILE--
  13. <?php
  14. echo "*** Test substituting argument 1 with boolean values ***\n";
  15. $variation_array = array(
  16. 'lowercase true' => true,
  17. 'lowercase false' =>false,
  18. 'uppercase TRUE' =>TRUE,
  19. 'uppercase FALSE' =>FALSE,
  20. );
  21. foreach ( $variation_array as $var ) {
  22. var_dump(posix_setuid( $var ) );
  23. }
  24. ?>
  25. --EXPECTF--
  26. *** Test substituting argument 1 with boolean values ***
  27. bool(false)
  28. bool(false)
  29. bool(false)
  30. bool(false)