posix_errno_variation2.phpt 692 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Test function posix_errno() by calling it with its expected arguments
  3. --CREDITS--
  4. Morten Amundsen mor10am@gmail.com
  5. Francesco Fullone ff@ideato.it
  6. #PHPTestFest Cesena Italia on 2009-06-20
  7. --SKIPIF--
  8. <?php
  9. if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
  10. if(!extension_loaded("pcntl")) print "skip - PCNTL extension required";
  11. ?>
  12. --FILE--
  13. <?php
  14. echo "*** Test by calling function with pid error ***\n";
  15. $pid = 10000;
  16. do {
  17. $pid += 1;
  18. $result = shell_exec("ps -p " . $pid);
  19. } while (strstr($pid, $result));
  20. posix_kill($pid, SIGKILL);
  21. var_dump(posix_errno());
  22. ?>
  23. --EXPECTF--
  24. *** Test by calling function with pid error ***
  25. int(3)