This commit is contained in:
hashbro
2026-08-09 02:42:28 +08:00
parent 5c7600744e
commit 6489808fa5
8 changed files with 150 additions and 26 deletions
+21
View File
@@ -61,6 +61,27 @@ class TelegramBotTest extends TestCase
)->assertNoContent();
}
#[Test]
public function webhook_acks_even_when_bot_run_fails(): void
{
$this->app->bind(Nutgram::class, function () {
throw new \RuntimeException('deliberate nutgram failure');
});
$this->call(
'POST',
'/hooks/telegram',
[],
[],
[],
[
'CONTENT_TYPE' => 'application/json',
'HTTP_X_TELEGRAM_BOT_API_SECRET_TOKEN' => 'test-secret',
],
json_encode(['update_id' => 99, 'message' => ['text' => '/ping']])
)->assertNoContent();
}
#[Test]
public function unauthorized_chat_is_silent(): void
{