Added SendAnimation method
This commit is contained in:
parent
02d9fe69d9
commit
4935373cda
4 changed files with 141 additions and 0 deletions
38
tests/TgBotLib/Methods/SendAnimationTest.php
Normal file
38
tests/TgBotLib/Methods/SendAnimationTest.php
Normal 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());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue