Skip to content
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.6] Set MAIL_DRIVER to array in phpunit.xml #4607

Merged
merged 1 commit into from
Mar 13, 2018

Conversation

shadoWalker89
Copy link
Contributor

Set the array driver as a default for testing to avoid sending emails with smtp the default driver which slows down tests

@ludo237
Copy link

ludo237 commented Mar 13, 2018

@shadoWalker89 what about <env name="MAIL_DRIVER" value="log"/>? is it faster or slower?

I use log because you can actually see the content of the email, the array option does not allow that.

@GrahamCampbell GrahamCampbell changed the title Set MAIL_DRIVER to array in phpunit.xml [5.6] Set MAIL_DRIVER to array in phpunit.xml Mar 13, 2018
@GuidoHendriks
Copy link

@ludo237 Why would you need the emails of your tests being logged?

@ludo237
Copy link

ludo237 commented Mar 13, 2018

@GuidoHendriks it can be useful when you need to verify the content of the email

@GuidoHendriks
Copy link

@ludo237 That's not something you'd want to use logging generally, I'd say. And definitely won't make a good default setting in my opinion.

@shadoWalker89
Copy link
Contributor Author

My guess is during tests you don't need to open the log to check the email because your have your tests checking them for you.
In theory array driver is faster then log because of the i/o operations of the log driver.
I guess when you want to work on the ui of your email you should render the mailable in the browser or use a service like mailtrap

@taylorotwell taylorotwell merged commit c892bd3 into laravel:master Mar 13, 2018
@shadoWalker89 shadoWalker89 deleted the patch-2 branch March 13, 2018 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants