Added GetMeTest
This commit is contained in:
parent
75acf6aad5
commit
71589e1871
1 changed files with 38 additions and 0 deletions
38
tests/TgBotLib/Methods/GetMeTest.php
Normal file
38
tests/TgBotLib/Methods/GetMeTest.php
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace TgBotLib\Methods;
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use TgBotLib\Bot;
|
||||||
|
use TgBotLib\Objects\User;
|
||||||
|
|
||||||
|
class GetMeTest extends TestCase
|
||||||
|
{
|
||||||
|
const int TEST_CHAT_ID = -1001301191379;
|
||||||
|
private static Bot $bot;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function setUpBeforeClass(): void
|
||||||
|
{
|
||||||
|
self::$bot = new Bot(BOT_TOKEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the `getMe` function of the bot instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testGetMe(): void
|
||||||
|
{
|
||||||
|
$result = self::$bot->getMe();
|
||||||
|
|
||||||
|
$this->assertInstanceOf(User::class, $result);
|
||||||
|
$this->assertEquals(7591266486, $result->getId());
|
||||||
|
$this->assertEquals('Debug Bot', $result->getFirstName());
|
||||||
|
$this->assertNull($result->getLastName());
|
||||||
|
$this->assertEquals('PublicDebuggingBot', $result->getUsername());
|
||||||
|
$this->assertTrue($result->isBot());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue