Skip to content

Commit 065e4b8

Browse files
authored
Prevent $mailer being reset when testing mailables that implement ShouldQueue (#42695)
1 parent 6d2d78c commit 065e4b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Illuminate/Support/Testing/Fakes/MailFake.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,13 @@ public function send($view, array $data = [], $callback = null)
363363

364364
$view->mailer($this->currentMailer);
365365

366-
$this->currentMailer = null;
367366

368367
if ($view instanceof ShouldQueue) {
369368
return $this->queue($view, $data);
370369
}
371370

371+
$this->currentMailer = null;
372+
372373
$this->mailables[] = $view;
373374
}
374375

0 commit comments

Comments
 (0)