Closed perkola closed 7 years ago
That's what happens inside assertSent
:
public function assertSent($mailable, $callback = null)
{
PHPUnit::assertTrue(
$this->sent($mailable, $callback)->count() > 0,
"The expected [{$mailable}] mailable was not sent."
);
}
A proper assertion is used as you can see, and PHPUnit returns:
The expected [App\Mail\TestMail] mailable was not sent.
Failed asserting that false is true.
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
Closing for lack of activity and being unable to replicate.
Description:
When mocking mail using
Mail::assetSent
, PHPUnit flags the test case as risky with the following explanation:Steps To Reproduce:
The following test case was used:
The
OrderShipped
mailable is invoked on the route/orders
with:Without sending the JSON request to the API the mailable is never sent and PHPUnit yield the following:
This expects me to believe that the
assertSent
method never results in a proper assertion required by PHPUnit as the mail seems to be sent and the test case passes as risky.