Skip to content

Commit

Permalink
Fixing config in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSteveKing committed Apr 21, 2023
1 parent 7af68c0 commit 631639c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Builder/PendingWebhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ public function queue(null|string $queue = null): PendingDispatch|PendingClosure
public function send(Method $method = Method::POST): Response
{
if (null === $this->request) {
$this->intercept(fn (PendingRequest $request) => $request
->timeout(intval(config('webhooks.request.timeout'))),
$this->intercept(
fn (PendingRequest $request) => $request
->timeout(intval(config('webhooks.request.timeout'))),
);
}

Expand Down
17 changes: 17 additions & 0 deletions tests/PackageTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@

abstract class PackageTestCase extends TestCase
{
protected function setUp(): void
{
parent::setUp();

$this->configure(
app: $this->app,
);
}

protected function configure(Application $app): void
{
$app['config']['webhooks.signing.header'] = 'Signature';
$app['config']['webhooks.signing.key'] = '123456';
$app['config']['webhooks.user_agent.name'] = 'Laravel_Webhooks_Test';
$app['config']['webhooks.request.timeout'] = 15;
}

/**
* @param Application $app
* @return array<int,class-string>
Expand Down

0 comments on commit 631639c

Please sign in to comment.