From c19afaf30f67838b6b3d2da0afcbff98ff6029f3 Mon Sep 17 00:00:00 2001 From: Martin Bean Date: Fri, 20 Jul 2018 17:52:07 +0100 Subject: [PATCH] Add hint to mail fake (#24911) * Add hint to mail fake * Style fixes --- src/Illuminate/Support/Testing/Fakes/MailFake.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Support/Testing/Fakes/MailFake.php b/src/Illuminate/Support/Testing/Fakes/MailFake.php index 48392d1d1b9d..429f089bacc1 100644 --- a/src/Illuminate/Support/Testing/Fakes/MailFake.php +++ b/src/Illuminate/Support/Testing/Fakes/MailFake.php @@ -36,9 +36,15 @@ public function assertSent($mailable, $callback = null) return $this->assertSentTimes($mailable, $callback); } + $message = "The expected [{$mailable}] mailable was not sent."; + + if (count($this->queuedMailables) > 0) { + $message .= ' Did you mean to use assertQueued() instead?'; + } + PHPUnit::assertTrue( $this->sent($mailable, $callback)->count() > 0, - "The expected [{$mailable}] mailable was not sent." + $message ); }