Skip to content

Commit

Permalink
Add hint to mail fake (#24911)
Browse files Browse the repository at this point in the history
* Add hint to mail fake

* Style fixes
  • Loading branch information
martinbean authored and taylorotwell committed Jul 20, 2018
1 parent 74252d1 commit c19afaf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Illuminate/Support/Testing/Fakes/MailFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand Down

0 comments on commit c19afaf

Please sign in to comment.