public function createProcessManager($receiver = null)
{
$runtime = $this->getMock(RuntimeContainerInterface::class, [], [], '', false);
$runtime->expects($this->any())->method('getParent')->will($this->returnValue('parent'));
$channel = $this->getMock(ChannelInterface::class, [], [], '', false);
$manager = $this->getMock(ProcessManagerRemote::class, ['createRequest'], [$runtime, $channel, $receiver]);
$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;
}