File
- drupal/core/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php, line 343
Class
- AbstractProcessTest
- @author Robert Schönthal <seroscho@googlemail.com>
Namespace
Symfony\Component\Process\Tests
Code
public function testProcessThrowsExceptionWhenExternallySignaled() {
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$this
->markTestSkipped('Windows does not support POSIX signals');
}
if (!function_exists('posix_kill')) {
$this
->markTestSkipped('posix_kill is required for this test');
}
$termSignal = defined('SIGKILL') ? SIGKILL : 9;
$process = $this
->getProcess('exec php -r "while (true) {}"');
$process
->start();
posix_kill($process
->getPid(), $termSignal);
$this
->setExpectedException('Symfony\\Component\\Process\\Exception\\RuntimeException', 'The process has been signaled with signal "9".');
$process
->wait();
}