|
@@ -531,9 +531,10 @@ class TelegramChannelTest extends TestCase
|
|
|
$this->migrate();
|
|
$this->migrate();
|
|
|
$this->app->register(FilesystemServiceProvider::class);
|
|
$this->app->register(FilesystemServiceProvider::class);
|
|
|
$text = str_repeat('正文', 600);
|
|
$text = str_repeat('正文', 600);
|
|
|
|
|
+ $buttons = [[['text' => '详情', 'url' => 'https://example.com']]];
|
|
|
$channel = $this->service->save([
|
|
$channel = $this->service->save([
|
|
|
'chatId' => '@first_channel', 'type' => 'image',
|
|
'chatId' => '@first_channel', 'type' => 'image',
|
|
|
- 'image' => 'https://files.example.test/photo.jpg', 'text' => $text,
|
|
|
|
|
|
|
+ 'image' => 'https://files.example.test/photo.jpg', 'text' => $text, 'button' => $buttons,
|
|
|
]);
|
|
]);
|
|
|
$this->telegramResult(['message_id' => 18]);
|
|
$this->telegramResult(['message_id' => 18]);
|
|
|
$this->telegramResult(['message_id' => 19]);
|
|
$this->telegramResult(['message_id' => 19]);
|
|
@@ -542,7 +543,9 @@ class TelegramChannelTest extends TestCase
|
|
|
parse_str((string) $this->requests[0]['request']->getBody(), $media);
|
|
parse_str((string) $this->requests[0]['request']->getBody(), $media);
|
|
|
parse_str((string) $this->requests[1]['request']->getBody(), $body);
|
|
parse_str((string) $this->requests[1]['request']->getBody(), $body);
|
|
|
$this->assertSame('', $media['caption']);
|
|
$this->assertSame('', $media['caption']);
|
|
|
|
|
+ $this->assertArrayNotHasKey('reply_markup', $media);
|
|
|
$this->assertSame($text, $body['text']);
|
|
$this->assertSame($text, $body['text']);
|
|
|
|
|
+ $this->assertSame(['inline_keyboard' => $buttons], json_decode($body['reply_markup'], true));
|
|
|
|
|
|
|
|
$this->telegramResult(['message_id' => 20]);
|
|
$this->telegramResult(['message_id' => 20]);
|
|
|
$this->telegram->append(new Response(400, [], '{"ok":false,"error_code":400,"description":"rejected"}'));
|
|
$this->telegram->append(new Response(400, [], '{"ok":false,"error_code":400,"description":"rejected"}'));
|