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? (30 h 01 min)

You also get:

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

Already a member? Login here

Comments & Discussion

FI
First Iraqi Bank ✓ Link copied!

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 ?

PK
Povilas Korop ✓ Link copied!

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

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.