[Process] Prevented test from failing when pcntl extension is not enabled.
SIGTERM constant is only defined if pcntl extension is present. Extension is not needed to use the Process component though.
This commit is contained in:
parent
477ddfb44d
commit
a5aeb21b84
@ -233,10 +233,14 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->markTestSkipped('Windows does not support POSIX signals');
|
$this->markTestSkipped('Windows does not support POSIX signals');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SIGTERM is only defined if pcntl extension is present
|
||||||
|
$termSignal = defined('SIGTERM') ? SIGTERM : 15;
|
||||||
|
|
||||||
$process = $this->getProcess('php -r "while (true) {}"');
|
$process = $this->getProcess('php -r "while (true) {}"');
|
||||||
$process->start();
|
$process->start();
|
||||||
$process->stop();
|
$process->stop();
|
||||||
$this->assertEquals(SIGTERM, $process->getTermSignal());
|
|
||||||
|
$this->assertEquals($termSignal, $process->getTermSignal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPhpDeadlock()
|
public function testPhpDeadlock()
|
||||||
|
Reference in New Issue
Block a user