[Process] Fix failing test on php 8.
This commit is contained in:
parent
d8bb5b2df5
commit
98e5105bd3
@ -992,24 +992,16 @@ class ProcessTest extends TestCase
|
|||||||
$this->markTestSkipped('POSIX signals do not work on Windows');
|
$this->markTestSkipped('POSIX signals do not work on Windows');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\PHP_VERSION_ID < 80000 || \is_int($signal)) {
|
$this->expectException(RuntimeException::class);
|
||||||
$this->expectException(RuntimeException::class);
|
|
||||||
} else {
|
|
||||||
$this->expectException('TypeError');
|
|
||||||
}
|
|
||||||
|
|
||||||
$process = $this->getProcessForCode('sleep(38);');
|
$process = $this->getProcessForCode('sleep(38);');
|
||||||
$process->start();
|
$process->start();
|
||||||
try {
|
try {
|
||||||
$process->signal(-4);
|
$process->signal(-4);
|
||||||
$this->fail('A RuntimeException must have been thrown');
|
$this->fail('A RuntimeException must have been thrown');
|
||||||
} catch (\TypeError $e) {
|
} finally {
|
||||||
$process->stop(0);
|
|
||||||
} catch (RuntimeException $e) {
|
|
||||||
$process->stop(0);
|
$process->stop(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw $e;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDisableOutputDisablesTheOutput()
|
public function testDisableOutputDisablesTheOutput()
|
||||||
|
Reference in New Issue
Block a user