Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 497c875

Browse files
committed
minor #11539 [Process] Fix tests when pcntl is not available. (jakzal)
This PR was merged into the 2.3 branch. Discussion ---------- [Process] Fix tests when pcntl is not available. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - It's solved the same way in the [AbstractProcessTest](https://github.com/symfony/symfony/blob/3b837dc5c102b8210b7038029416c0524d5f458b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php#L602-L603). Commits ------- e40f24f [Process] Fix tests when pcntl is not available.
2 parents a292a48 + e40f24f commit 497c875

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Process/Tests/SimpleProcessTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function testKillSignalTerminatesProcessCleanly()
167167
$process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"');
168168
$process->run(function () use ($process) {
169169
if ($process->isRunning()) {
170-
$process->signal(SIGKILL);
170+
$process->signal(defined('SIGKILL') ? SIGKILL : 9);
171171
}
172172
});
173173
} catch (RuntimeException $e) {
@@ -183,7 +183,7 @@ public function testTermSignalTerminatesProcessCleanly()
183183
$process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"');
184184
$process->run(function () use ($process) {
185185
if ($process->isRunning()) {
186-
$process->signal(SIGTERM);
186+
$process->signal(defined('SIGTERM') ? SIGTERM : 15);
187187
}
188188
});
189189
} catch (RuntimeException $e) {

0 commit comments

Comments
 (0)