$this->
assertStringEndsWith('/sendMessage',
$url);
$this->
assertSame($expectedBody,
json_decode($options['body'
], true
));
return $response;
});
$transport = self::
createTransport($client, 'testChannel'
);
$sentMessage =
$transport->
send(new ChatMessage('testMessage'
));
$this->
assertEquals(1,
$sentMessage->
getMessageId());
$this->
assertEquals('telegram://api.telegram.org?channel=testChannel',
$sentMessage->
getTransport());
} public function testSendWithOptionForEditMessage() { $response =
$this->
createMock(ResponseInterface::
class);
$response->
expects($this->
exactly(2
)) ->
method('getStatusCode'
) ->
willReturn(200
);
$content = <<<JSON
{
"ok": true,
"result": {
"message_id": 1,
"from": {
"id": 12345678,
"first_name": "YourBot",
"username": "YourBot"
},
"chat": {
"id": 1234567890,
"first_name": "John",
"last_name": "Doe",
"username": "JohnDoe",
"type": "private"
},
"date": 1459958199,
"text": "Hello from Bot!"
}
}