[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:
Jakub Zalas 2012-12-30 13:18:39 +01:00
parent 477ddfb44d
commit a5aeb21b84
1 changed files with 5 additions and 1 deletions

View File

@ -233,10 +233,14 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
$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->start();
$process->stop();
$this->assertEquals(SIGTERM, $process->getTermSignal());
$this->assertEquals($termSignal, $process->getTermSignal());
}
public function testPhpDeadlock()