Skip to content

[5.6] Add hint to mail fake#24911

Merged
taylorotwell merged 2 commits into
laravel:5.6from
martinbean:patch-1
Jul 20, 2018
Merged

[5.6] Add hint to mail fake#24911
taylorotwell merged 2 commits into
laravel:5.6from
martinbean:patch-1

Conversation

@martinbean
Copy link
Copy Markdown
Contributor

In Laravel, you have to use different assertions in tests depending on if you’re queuing a mailable, or immediately sending one.

The head of development at the company I work for has just spent some time trying to test a mailable was sent that he was actually queuing. I’ve made the mistake myself in the past. I’m sure countless other developers have too.

Given that developers of all skill levels get bit by this, I’m proposing to amend the error message in assertSent() to append “Did you mean to use assertQueued() instead?” if there is one or more queued mailables. This should hopefully save a few developer headaches in the future!

@taylorotwell taylorotwell merged commit c19afaf into laravel:5.6 Jul 20, 2018
@martinbean martinbean deleted the patch-1 branch July 21, 2018 11:14
@GrahamCampbell GrahamCampbell changed the title Add hint to mail fake [5.6] Add hint to mail fake Jul 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants