From 5e16cedbe32e013cbf34eb77740c22b390beceee Mon Sep 17 00:00:00 2001 From: freek Date: Fri, 14 Jun 2019 01:27:14 +0200 Subject: [PATCH] wip --- tests/WebhookControllerTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/WebhookControllerTest.php b/tests/WebhookControllerTest.php index 2c6620c..51db7de 100644 --- a/tests/WebhookControllerTest.php +++ b/tests/WebhookControllerTest.php @@ -90,6 +90,23 @@ public function it_can_work_with_an_alternative_profile() $this->assertCount(0, WebhookCall::get()); } + /** @test */ + public function it_can_work_with_an_alternative_config() + { + Route::webhooks('incoming-webhooks-alternative-config', 'alternative-config'); + + $this + ->postJson('incoming-webhooks-alternative-config', $this->payload, $this->headers) + ->assertStatus(Response::HTTP_INTERNAL_SERVER_ERROR); + + config()->set('webhook-client.0.name', 'alternative-config'); + + $this + ->postJson('incoming-webhooks-alternative-config', $this->payload, $this->headers) + ->assertSuccessful(); + + } + private function determineSignature(array $payload): string { $secret = config('webhook-client.0.signing_secret');