-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.5] Allow MailFake to assert mailables were queued #20454
[5.5] Allow MailFake to assert mailables were queued #20454
Conversation
* @return \Illuminate\Support\Collection | ||
*/ | ||
protected function mailablesOf($type) | ||
protected function mailablesOf($type, $queued = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just my two cents but I'd make this a separate method. It would only be duplicating three lines and a method called queuedMailablesOf
makes the intent much clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, thank you!
Added a commit that changes thi
Not entirely related, but perhaps we could build the view so the user knows that there are syntax errors or any other kind of error. I opened an issue in |
So would this be a breaking change? |
@mateusjatenee building the view is a separate test IMO. and one that can already be written pretty easily. |
This also doesn't work correctly if a Mailable is implementing ShouldQueue and is sent using Mail::send() |
@taylorotwell Sorry I forgot to queue it if It implemented I added some code that verifies if the mailable implements the interface and queues if it does. Given #20485 was approved I also added the option to specify how many times it should have been queued. It would be a BC, yes.. but I believe it's worth it as the "migration" is very simple and verifying a mailable was queued with |
Thanks |
Hey everyone,
Right now when you queue a mailable you have to either assert it was
sent
(it was not, as it was queued) or you have to assertIlluminate\Mail\SendQueuedMailable
was pushed on to the queue.This PR gives queued mailables their own property and allows assertions to be made, such as
assertWasQueued($mailable)
.Let me know what you guys think!