public function testSignal() {
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$this
->markTestSkipped('POSIX signals do not work on windows');
}
$process = $this
->getProcess('exec php -f ' . __DIR__ . '/SignalListener.php');
$process
->start();
usleep(500000);
$process
->signal(SIGUSR1);
while ($process
->isRunning() && false === strpos($process
->getoutput(), 'Caught SIGUSR1')) {
usleep(10000);
}
$this
->assertEquals('Caught SIGUSR1', $process
->getOutput());
}