From 25432a931bad118ad4334662d59de6e1d4c6dd6d Mon Sep 17 00:00:00 2001 From: Luke Kuzmish Date: Mon, 20 Jan 2025 06:18:31 -0500 Subject: [PATCH] test for overriding with onQueue() and onConnection() --- .../Bus/BusPendingDispatchWithAttributesTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Integration/Bus/BusPendingDispatchWithAttributesTest.php b/tests/Integration/Bus/BusPendingDispatchWithAttributesTest.php index 50d4174d852..51e1ff62b5e 100644 --- a/tests/Integration/Bus/BusPendingDispatchWithAttributesTest.php +++ b/tests/Integration/Bus/BusPendingDispatchWithAttributesTest.php @@ -91,6 +91,21 @@ public function testWorksWithDispatchFunction(): void && $job->value === 'laravel' ); } + + public function testIgnoresAttributesWhenCallingOnQueueAndOnConnection(): void + { + Queue::fake(); + + FakeJobWithAttributesUsingEnums::dispatch(76543) + ->onQueue('called-onQueue') + ->onConnection('called-onConnection'); + + Queue::assertPushed( + fn (FakeJobWithAttributesUsingEnums $job) => $job->queue === 'called-onQueue' + && $job->connection == 'called-onConnection' + && $job->value === 76543 + ); + } } #[OnQueue('queue-from-attribute')]