[Process] Fix failing test on php 8.

This commit is contained in:
Alexander M. Turek 2020-05-23 21:47:49 +02:00
parent d8bb5b2df5
commit 98e5105bd3
1 changed files with 2 additions and 10 deletions

View File

@ -992,24 +992,16 @@ class ProcessTest extends TestCase
$this->markTestSkipped('POSIX signals do not work on Windows');
}
if (\PHP_VERSION_ID < 80000 || \is_int($signal)) {
$this->expectException(RuntimeException::class);
} else {
$this->expectException('TypeError');
}
$this->expectException(RuntimeException::class);
$process = $this->getProcessForCode('sleep(38);');
$process->start();
try {
$process->signal(-4);
$this->fail('A RuntimeException must have been thrown');
} catch (\TypeError $e) {
$process->stop(0);
} catch (RuntimeException $e) {
} finally {
$process->stop(0);
}
throw $e;
}
public function testDisableOutputDisablesTheOutput()