posix_setuid_variation5.phpt 740 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Test function posix_setuid() by substituting argument 1 with int 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 int values ***\n";
  15. $variation_array = array (
  16. 'int 0' => 0,
  17. 'int 1' => 1,
  18. 'int -12345' => -12345,
  19. );
  20. foreach ( $variation_array as $var ) {
  21. var_dump(posix_setuid( $var ) );
  22. }
  23. ?>
  24. --EXPECTF--
  25. *** Test substituting argument 1 with int values ***
  26. bool(false)
  27. bool(false)
  28. bool(false)