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](3b837dc5c1/src/Symfony/Component/Process/Tests/AbstractProcessTest.php (L602-L603)
). Commits -------e40f24f
[Process] Fix tests when pcntl is not available.
This commit is contained in:
commit
497c875304
@ -167,7 +167,7 @@ class SimpleProcessTest extends AbstractProcessTest
|
|||||||
$process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"');
|
$process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"');
|
||||||
$process->run(function () use ($process) {
|
$process->run(function () use ($process) {
|
||||||
if ($process->isRunning()) {
|
if ($process->isRunning()) {
|
||||||
$process->signal(SIGKILL);
|
$process->signal(defined('SIGKILL') ? SIGKILL : 9);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (RuntimeException $e) {
|
} catch (RuntimeException $e) {
|
||||||
@ -183,7 +183,7 @@ class SimpleProcessTest extends AbstractProcessTest
|
|||||||
$process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"');
|
$process = $this->getProcess('php -r "echo \'foo\'; sleep(1); echo \'bar\';"');
|
||||||
$process->run(function () use ($process) {
|
$process->run(function () use ($process) {
|
||||||
if ($process->isRunning()) {
|
if ($process->isRunning()) {
|
||||||
$process->signal(SIGTERM);
|
$process->signal(defined('SIGTERM') ? SIGTERM : 15);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (RuntimeException $e) {
|
} catch (RuntimeException $e) {
|
||||||
|
Reference in New Issue
Block a user