laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 31 forks source link

Fake Only Specific Queue Connections #2626

Open MannikJ opened 3 years ago

MannikJ commented 3 years ago

I just had to find out that

Queue::fake('redis');

and

Queue::fake()->setConnectionName('redis');

don't do want what I hoped they would do.

So first of all, is there maybe already a way to only fake certain queue connections instead of all at once? Faking via the Queue facade like I showed above prevents all queues from being processed.

I think it is a valid and not too uncommon use case to only want to fake connections that use async drivers like redis - because those async jobs are often dependent on external systems etc. - but just let the other (especially sync) connections execute just normal.