diff --git a/src/Checks/Checks/QueueCheck.php b/src/Checks/Checks/QueueCheck.php index dd4d77d5..d35809c9 100644 --- a/src/Checks/Checks/QueueCheck.php +++ b/src/Checks/Checks/QueueCheck.php @@ -57,7 +57,7 @@ public function onQueue(array|string $queue): self public function getQueues(): array { - return $this->onQueues ?? [$this->getDefaultQueue(config('queue.driver'))]; + return $this->onQueues ?? [$this->getDefaultQueue(config('queue.default'))]; } protected function getDefaultQueue($connection) diff --git a/tests/Checks/QueueCheckTest.php b/tests/Checks/QueueCheckTest.php index e13bf1ee..b7c099d9 100644 --- a/tests/Checks/QueueCheckTest.php +++ b/tests/Checks/QueueCheckTest.php @@ -97,3 +97,15 @@ Queue::assertPushedOn('email', HealthQueueJob::class); Queue::assertPushedOn('payment', HealthQueueJob::class); }); + +it('can get default queue settings', function () { + // Set default queue connection + $queueConnection = uniqid('connection'); + config()->set('queue.default', $queueConnection); + + // Set default queue name + $queueName = uniqid('queue'); + config()->set("queue.connections.{$queueConnection}.queue", $queueName); + + expect($this->queueCheck->getQueues())->toBe([$queueName]); +});