mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-30 14:09:58 +08:00
use Mail::fake()
This commit is contained in:
parent
3f77c98783
commit
7524041a76
@ -401,6 +401,8 @@ class AuthControllerTest extends TestCase
|
||||
|
||||
public function testHandleForgot()
|
||||
{
|
||||
Mail::fake();
|
||||
|
||||
// Should return a warning if `captcha` is wrong
|
||||
$this->withSession(['phrase' => 'a'])->postJson('/auth/forgot', [
|
||||
'captcha' => 'b'
|
||||
@ -443,9 +445,7 @@ class AuthControllerTest extends TestCase
|
||||
$user->getToken().substr(time(), 4, 6).str_random(16)
|
||||
);
|
||||
$url = Option::get('site_url')."/auth/reset?uid=$uid&token=$token";
|
||||
// An email should be send
|
||||
// Laravel supports `Mail::fake()` since v5.4, but now we cannot
|
||||
// Thanks: https://stackoverflow.com/questions/31120567/unittesting-laravel-5-mail-using-mock
|
||||
// @see https://stackoverflow.com/questions/31120567/unittesting-laravel-5-mail-using-mock
|
||||
Mail::shouldReceive('send')
|
||||
->once()
|
||||
->with(
|
||||
|
Loading…
Reference in New Issue
Block a user