Annotation of embedaddon/php/ext/pcntl/tests/pcntl_signal.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: pcntl_signal()
! 3: --SKIPIF--
! 4: <?php if (!extension_loaded("pcntl")) print "skip"; ?>
! 5: <?php if (!extension_loaded("posix")) die("skip posix extension not available"); ?>
! 6: --FILE--
! 7: <?php
! 8: pcntl_signal(SIGTERM, function($signo){
! 9: echo "signal dispatched\n";
! 10: });
! 11: posix_kill(posix_getpid(), SIGTERM);
! 12: pcntl_signal_dispatch();
! 13:
! 14: var_dump(pcntl_signal());
! 15: var_dump(pcntl_signal(SIGALRM, SIG_IGN));
! 16: var_dump(pcntl_signal(-1, -1));
! 17: var_dump(pcntl_signal(-1, function(){}));
! 18: var_dump(pcntl_signal(SIGALRM, "not callable"));
! 19:
! 20:
! 21: /* test freeing queue in RSHUTDOWN */
! 22: posix_kill(posix_getpid(), SIGTERM);
! 23: echo "ok\n";
! 24: ?>
! 25: --EXPECTF--
! 26: signal dispatched
! 27:
! 28: Warning: pcntl_signal() expects at least 2 parameters, 0 given in %s
! 29: NULL
! 30: bool(true)
! 31:
! 32: Warning: pcntl_signal(): Invalid value for handle argument specified in %s
! 33:
! 34: Warning: pcntl_signal(): Error assigning signal %s
! 35: bool(false)
! 36:
! 37: Warning: pcntl_signal(): Error assigning signal %s
! 38: bool(false)
! 39:
! 40: Warning: pcntl_signal(): not callable is not a callable function name error in %s
! 41: bool(false)
! 42: ok
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>