Annotation of embedaddon/php/ext/pcntl/tests/pcntl_signal.phpt, revision 1.1.1.2

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: 
1.1.1.2 ! misho      32: Warning: pcntl_signal(): Invalid signal %s
1.1       misho      33: bool(false)
                     34: 
1.1.1.2 ! misho      35: Warning: pcntl_signal(): Invalid signal %s
1.1       misho      36: bool(false)
                     37: 
                     38: Warning: pcntl_signal(): not callable is not a callable function name error in %s
                     39: bool(false)
                     40: ok

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>