How to test jobs in Laravel
Michiel Gerritsen shows us how to test jobs in Laravel.
Recently someone in a Slack channel i’m a member of asked the following:
I want to test if job A fires job B, but how do you test something like that?
Niek ten Hoopen Especially when the queue is set up to be run asychronus this seems impossible to test. The normal flow would be something like this:
Controller -> job A -> job B Now how do you test this? The answer is pretty simple: You test job A separate from your controller and job B
Link:
This post is submitted by our members. Submit a new post.
Tags: Tutorials Laravel 5.8 Laravel 5.7 Tricks Laravel 5.6 Laravel 5 Intermediate