You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: services/mail.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -465,3 +465,18 @@ You can dynamically disable sending mail using the `Mail::pretend` method. When
465
465
```php
466
466
Mail::pretend();
467
467
```
468
+
469
+
### Unit testing
470
+
471
+
When unit testing, you may want to utilize Laravel's `fake` method on the Mail facade. This ensures your local configuration is ignored and mailing assertions can be performed without sending emails while your tests are running:
472
+
473
+
```php
474
+
Mail::fake();
475
+
476
+
// ... Run code that sends email 'this.is.my.email' template.
477
+
478
+
// Check that the email was sent
479
+
Mail::assertSent('this.is.my.email', function ($mail) {
0 commit comments