public function createProcessManager($methods = [])
{
$core = $this->getMock(CoreInterface::class, [], [], '', false);
$core->expects($this->any())->method('getDataPath')->will($this->returnValue(''));
$core->expects($this->any())->method('getDataDir')->will($this->returnValue(''));
$runtime = $this->getMock(RuntimeContainerInterface::class, [], [], '', false);
$runtime->expects($this->any())->method('getCore')->will($this->returnValue($core));
$channel = $this->getMock(ChannelInterface::class, [], [], '', false);
$system = $this->getMock(SystemInterface::class, [], [], '', false);
$fs = $this->getMock(FilesystemInterface::class, [], [], '', false);
$fs->expects($this->any())->method('exists')->will($this->returnValue(false));
$fs->expects($this->any())->method('write')->will($this->returnValue(null));
$methods = array_merge($methods, ['createRequest']);
$manager = $this->getMock(ProcessManagerBase::class, $methods, [$runtime, $channel, [], $system, $fs]);
$manager->expects($this->any())->method('createRequest')->will($this->returnCallback(function ($channel, $receiver, $command) {
$this->command = $command;
$mock = $this->getMock(RuntimeCommand::class, ['call'], [$channel, $receiver, $command]);
$mock->expects($this->once())->method('call')->will($this->returnValue(new PromiseFulfilled()));
return $mock;
}));
return $manager;
}