Skip to main content

Testing Job Dispatching with Bus::fake()

Premium
2:16

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

First Iraqi Bank avatar

Hello Povilas,

I found that in order to test the code inside the job(for example you created a record in db inside the job, and assert), I supposed to change set the QUEUE_CONNECTION to sync in .env.testing file, otherwise the testcase fails, is that the correct way of testing the code inside the job ?

👍 1
Povilas Korop avatar

Yes, from what I remember, for testing the queues should be disabled, like you're saying here.