public function testApiReceive_EmitsEvent_WhenResponseIsReceived()
{
$name = 'name';
$protocol = new Protocol();
$channel = $this->createChannel(['emit', 'handleReceiveRequest', 'handleReceiveResponse']);
$channel->expects($this->once())->method('emit')->with('input', [$name, $protocol]);
$channel->expects($this->once())->method('handleReceiveRequest')->with($protocol)->will($this->returnValue(false));
$channel->expects($this->once())->method('handleReceiveResponse')->with($protocol)->will($this->returnValue(true));
$channel->receive($name, $protocol);
}