From a5aeb21b842f7233633d582dd958655fbdbfd6cf Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Sun, 30 Dec 2012 13:18:39 +0100 Subject: [PATCH] [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. --- src/Symfony/Component/Process/Tests/AbstractProcessTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php index d8df0a5516..8cb9e4ad26 100644 --- a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php +++ b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php @@ -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()