public function testRestart() {
$process1 = $this
->getProcess('php -r "echo getmypid();"');
$process1
->run();
$process2 = $process1
->restart();
usleep(300000);
// wait for output
// Ensure that both processed finished and the output is numeric
$this
->assertFalse($process1
->isRunning());
$this
->assertFalse($process2
->isRunning());
$this
->assertTrue(is_numeric($process1
->getOutput()));
$this
->assertTrue(is_numeric($process2
->getOutput()));
// Ensure that restart returned a new process by check that the output is different
$this
->assertNotEquals($process1
->getOutput(), $process2
->getOutput());
}