-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForwardMessageTest.php
More file actions
37 lines (28 loc) · 1.09 KB
/
ForwardMessageTest.php
File metadata and controls
37 lines (28 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php namespace Tests\Bot\Methods;
use Tests\TelegramTestCase;
use TelegramPro\Bot\Methods\SendMessage;
use TelegramPro\Bot\Methods\Types\Message;
use TelegramPro\Bot\Methods\ForwardMessage;
use TelegramPro\Bot\Methods\Types\MessageText;
class ForwardMessageTest extends TelegramTestCase
{
function testCanForwardMessage()
{
$messageText = '[ForwardMessage] can forward message ' . rand(0, 32767);
$chatId = $this->config->cyclingChatId();
$response = SendMessage::parameters(
$chatId,
MessageText::fromString($messageText)
)->send($this->telegram);
$this->isOk($response);
self::assertInstanceOf(Message::class, $response->sentMessage());
$forwarded = ForwardMessage::parameters(
$chatId,
$chatId,
$response->sentMessage()->messageId()
)->send($this->telegram);
$this->isOk($forwarded);
self::assertInstanceOf(Message::class, $forwarded->sentMessage());
self::assertSame($messageText, $forwarded->sentMessage()->text());
}
}