43 lines
872 B
PHP
43 lines
872 B
PHP
![]() |
<?php
|
||
|
|
||
|
namespace TgBotLib\Methods;
|
||
|
|
||
|
use PHPUnit\Framework\TestCase;
|
||
|
use TgBotLib\Bot;
|
||
|
use TgBotLib\Enums\Types\ParseMode;
|
||
|
use TgBotLib\Objects\LinkPreviewOptions;
|
||
|
use TgBotLib\Objects\Message;
|
||
|
use TgBotLib\Objects\MessageId;
|
||
|
use TgBotLib\Objects\Update;
|
||
|
|
||
|
class GetUpdatesTest extends TestCase
|
||
|
{
|
||
|
private static Bot $bot;
|
||
|
|
||
|
/**
|
||
|
* @return void
|
||
|
*/
|
||
|
public static function setUpBeforeClass(): void
|
||
|
{
|
||
|
self::$bot = new Bot(BOT_TOKEN);
|
||
|
self::$bot->setAutoRetry(true);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Tests the `sendMessage` function of the bot instance.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function testGetUpdatesTest(): void
|
||
|
{
|
||
|
$result = self::$bot->getUpdates();
|
||
|
|
||
|
if(count($result) > 0)
|
||
|
{
|
||
|
$this->assertInstanceOf(Update::class, $result[0]);
|
||
|
}
|
||
|
|
||
|
$this->assertIsArray($result);
|
||
|
}
|
||
|
}
|