diff --git a/tests/TgBotLib/BotTest.php b/tests/TgBotLib/BotTest.php new file mode 100644 index 0000000..1932fd6 --- /dev/null +++ b/tests/TgBotLib/BotTest.php @@ -0,0 +1,43 @@ +bot = new Bot(BOT_TOKEN); + } + + /** + * Test sendRequest method of Bot class + * for valid method and parameters. + */ + public function testSendRequestValid(): void + { + $method = 'getMe'; + $parameters = ['text' => 'test message']; + + // assuming that sendMessage method is properly working + $result = $this->bot->sendRequest($method, $parameters); + + $this->assertIsArray($result); + } + + /** + * Test sendRequest method of Bot class + * for invalid method. + */ + public function testSendRequestInvalidMethod(): void + { + $method = 'invalidMethod'; + $parameters = []; + + $this->expectException(InvalidArgumentException::class); + + $this->bot->sendRequest($method, $parameters); + } +} \ No newline at end of file