Skip to content

Commit

Permalink
added test verify invalid signature
Browse files Browse the repository at this point in the history
  • Loading branch information
hellsythe committed Mar 27, 2024
1 parent 048936c commit 4a614a1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Feature/Message/ReceivedMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ public function test_recive_text_message_verify_signature()
});
}

public function test_recive_text_message_verify_signature_invalid()
{
Config::set('meta.webhook_verify_signature', true);

$messageId = 'wamid.'.$this->faker()->numberBetween(111, 450);
$wabaPhone = WabaPhone::factory()->create();
Event::fake();

$response = $this->withHeaders([
'x-hub-signature' => 'fake-signature',
])->post(route('meta.webhook'), FakeReceivedMessage::textMessage($wabaPhone, $messageId));
$response->assertStatus(403);
}

public function test_recive_text_message()
{
$messageId = 'wamid.'.$this->faker()->numberBetween(111, 450);
Expand Down

0 comments on commit 4a614a1

Please sign in to comment.