From 390e58a63b6c5adb25c25355355a8d55f99c3f2c Mon Sep 17 00:00:00 2001 From: Martin Bean Date: Fri, 20 Jul 2018 15:54:22 +0100 Subject: [PATCH 1/2] Add hint to mail fake --- 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..912efaa6df18 100644 --- a/src/Illuminate/Support/Testing/Fakes/MailFake.php +++ b/src/Illuminate/Support/Testing/Fakes/MailFake.php @@ -35,10 +35,16 @@ public function assertSent($mailable, $callback = null) if (is_numeric($callback)) { 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 ); } From d4016f2f237b9790380704bb7555a9080eaf7e42 Mon Sep 17 00:00:00 2001 From: Martin Bean Date: Fri, 20 Jul 2018 16:00:55 +0100 Subject: [PATCH 2/2] Style fixes --- src/Illuminate/Support/Testing/Fakes/MailFake.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Support/Testing/Fakes/MailFake.php b/src/Illuminate/Support/Testing/Fakes/MailFake.php index 912efaa6df18..429f089bacc1 100644 --- a/src/Illuminate/Support/Testing/Fakes/MailFake.php +++ b/src/Illuminate/Support/Testing/Fakes/MailFake.php @@ -35,11 +35,11 @@ public function assertSent($mailable, $callback = null) if (is_numeric($callback)) { 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?"; + $message .= ' Did you mean to use assertQueued() instead?'; } PHPUnit::assertTrue(