[Papercut Idea] assertDispatchedOnce
on Job/Event/Mail fakes.
#38734
Unanswered
paulandroshchuk
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
TLDR; just want to get a feedback whether it might be a good idea to add a new assertion method.
Laravel has a great API to test queued stuff like jobs/events/etc. Everything you need to do is to "fake" the needed facade and assert the job dispatched using the
assertDisptched()
helper.With this method, you can even assert that the right model was passed to the job:
and assert that the job was dispatched the needed number of times:
And what I'm used to do is to test both:
The "issue" here is that it takes two lines to test it, so I'm wondering, what you guys think about a new
assertDispatchedOnce
method? I can easily do a PR for this, just wanted to get some feedback first.Beta Was this translation helpful? Give feedback.
All reactions