Added SendAnimation method

This commit is contained in:
netkas 2024-10-09 13:29:09 -04:00
parent 02d9fe69d9
commit 4935373cda
4 changed files with 141 additions and 0 deletions

View file

@ -0,0 +1,38 @@
<?php
namespace TgBotLib\Methods;
use PHPUnit\Framework\TestCase;
use TgBotLib\Bot;
use TgBotLib\Enums\Types\ParseMode;
use TgBotLib\Objects\LinkPreviewOptions;
use TgBotLib\Objects\Message;
class SendAnimationTest extends TestCase
{
private static Bot $bot;
/**
* @return void
*/
public static function setUpBeforeClass(): void
{
self::$bot = new Bot(BOT_TOKEN);
}
/**
* Tests sending an animation file to a specified chat.
*
* @return void
*/
public function testSendAnimation(): void
{
$result = self::$bot->sendAnimation(
chat_id: TEST_CHAT_ID,
animation: __DIR__ . DIRECTORY_SEPARATOR . 'sample' . DIRECTORY_SEPARATOR . 'sticker.gif',
);
$this->assertInstanceOf(Message::class, $result);
$this->assertEquals(TEST_CHAT_ID, $result->getChat()->getId());
}
}