Can explain how to write test for webhook? #507
-
Explain please how to write tests for public function start(): void
{
$this->deleteKeyboard();
$this->chat
->message(
'this is start function'
)
->send();
} According to your documentation, I wrote a test, but unfortunately, it doesn't pass: public function testStart()
{
Telegraph::fake();
$chat = TelegraphChat::factory()->create();
Telegraph::message('/start')->send();
Telegraph::assertSent('this is function');
} It seems I am doing something wrong. I explored the dump, but there are only the data that was sent, namely the message '/start'. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Try this:
|
Beta Was this translation helpful? Give feedback.
-
@fabio-ivona Hello!
Thank you for your response, but could you please advise me on which specific test I should look into? |
Beta Was this translation helpful? Give feedback.
something like this: