public function testSimpleInputStream() { $input =
new InputStream();
$process =
$this->
getProcessForCode('echo \'ping\'; echo fread(STDIN, 4); echo fread(STDIN, 4);'
);
$process->
setInput($input);
$process->
start(function D
$type,
$data) use ($input) { if ('ping' ===
$data) { $input->
write('pang'
);
} elseif (!
$input->
isClosed()) { $input->
write('pong'
);
$input->
close();
} });
$process->
wait();
$this->
assertSame('pingpangpong',
$process->
getOutput());
} public function testInputStreamWithCallable() {