public function testApiSend_SendsMessageAsMessage_OnSuccess()
{
$protocol = $this->createProtocol();
$rep = $this->createResponse($protocol, 'secret');
$promise = new Promise();
$channel = $this->getProtectedProperty($rep, 'channel');
$channel->expects($this->once())->method('send')->will($this->returnCallback(function ($origin, ProtocolInterface $answer, $mode) {
$this->assertSame('secret', $answer->getMessage());
$this->assertSame('', $answer->getException());
$this->assertSame(Channel::MODE_BUFFER_ONLINE, $mode);
}));
$this->callProtectedMethod($rep, 'send', [$promise]);
}