Add more tests

parent 1fe2c5db
......@@ -227,18 +227,4 @@ class Response
return $results;
}
/**
* Return an empty Server Response
*
* No request to telegram are sent, this function is used in commands that
* don't need to fire a message after execution
*
* @return \Longman\TelegramBot\Http\Response
* @throws \Longman\TelegramBot\Exception\TelegramException
*/
public static function createEmpty()
{
return new static(['ok' => true, 'result' => true]);
}
}
......@@ -152,6 +152,24 @@ class TelegramTest extends TestCase
$this->assertInstanceOf(\Illuminate\Container\Container::class, $telegram->getContainer());
}
public function testHandleResponse()
{
$telegram = new Telegram(self::$dummy_api_key, 'testbot');
$response = $telegram->handle();
$this->assertInstanceOf(\Longman\TelegramBot\Http\Response::class, $response);
}
public function testHandleUpdatedResponse()
{
$telegram = new Telegram(self::$dummy_api_key, 'testbot');
$response = $telegram->handleGetUpdates();
$this->assertInstanceOf(\Longman\TelegramBot\Http\Response::class, $response);
}
public function testCustom()
{
$telegram = new Telegram(self::$dummy_api_key, 'testbot');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment