-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditMessageReplyMarkupTest.php
More file actions
89 lines (84 loc) · 3.02 KB
/
EditMessageReplyMarkupTest.php
File metadata and controls
89 lines (84 loc) · 3.02 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php namespace Tests\Bot\Methods;
use Tests\TelegramTestCase;
use TelegramPro\Bot\Methods\Types\Url;
use TelegramPro\Bot\Methods\SendMessage;
use TelegramPro\Bot\Methods\Types\Message;
use TelegramPro\Bot\Methods\Types\ParseMode;
use TelegramPro\Bot\Methods\Types\MessageText;
use TelegramPro\Bot\Methods\EditMessageReplyMarkup;
use TelegramPro\Bot\Types\ArrayOfInlineKeyboardRows;
use TelegramPro\Bot\Types\ArrayOfInlineKeyboardButtons;
use TelegramPro\Bot\Methods\Keyboards\ReplyKeyboardMarkup;
use TelegramPro\Bot\Methods\Keyboards\ReplyKeyboardRemove;
use TelegramPro\Bot\Methods\Keyboards\InlineKeyboardButton;
use TelegramPro\Bot\Methods\Keyboards\InlineKeyboardMarkup;
class EditMessageReplyMarkupTest extends TelegramTestCase
{
/**
* @doesNotPerformAssertions
* @todo this test
*/
function testEditChatMessageText()
{
// $chatId = $this->config->cyclingChatId();
//
// $sendMessageResponse = SendMessage::parameters(
// $chatId,
// MessageText::fromString('[EditMessageReplyMarkupTest] send initial message'),
// ParseMode::none(),
// true,
// true,
// null,
// new ReplyKeyboardMarkup(
// ArrayOfInlineKeyboardRows::fromList(
// ArrayOfInlineKeyboardButtons::fromList(
// new InlineKeyboardButton(
// 'OLD KEYBOARD'
// )
// )
// )
// )
// )->send($this->telegram);
//
// $response = EditMessageReplyMarkup::parametersForChat(
// $chatId,
// $sendMessageResponse->sentMessage()->messageId(),
// new ReplyKeyboardRemove(true)
// )->send($this->telegram);
//
// dd($response);
// $this->isOk($response);
//
// self::assertInstanceOf(Message::class, $response->editedMessage());
}
/**
* @todo test this once more inline message functionality is added
* @doesNotPerformAssertions
*/
function testCanEditInlineMessageText() {
}
// function testSendMarkdownMessage()
// {
// $response = SendMessage::parameters(
// $this->config->cyclingChatId(),
// MessageText::fromString('[SendMessage] send *markdown parsed* message')
// )->send($this->telegram);
//
// $this->isOk($response);
// self::assertInstanceOf(Message::class, $response->sentMessage());
// }
//
// function testCanParseError()
// {
// $response = EditMessageText::parametersForChat(
// $this->config->wrongGroupId(),
// MessageId::fromInt(123),
// MessageText::fromString('[EditMessageText] testing error')
// )->send($this->telegram);
//
// self::assertFalse($response->ok());
// self::assertInstanceOf(MethodError::class, $response->error());
// self::assertSame('400', $response->error()->code());
// self::assertNotEmpty($response->error()->description());
// }
}