public static getFakeUpdateCommandObject ( string $command_text ) : |
||
$command_text | string | |
return |
public static function getFakeUpdateCommandObject($command_text)
{
$data = ['update_id' => mt_rand(), 'message' => ['message_id' => mt_rand(), 'from' => self::$user_template, 'chat' => self::$chat_template, 'date' => time(), 'text' => $command_text]];
return self::getFakeUpdateObject($data);
}
public function testEchoCommandExecuteWithParameter() { $text = $this->command->setUpdate(TestHelpers::getFakeUpdateCommandObject('/echo Message!'))->execute()->getResult()->getText(); $this->assertEquals('Message!', $text); }