尝试在Laravel中发送电子邮件时,http测试会崩溃

时间:2017-07-19 16:46:06

标签: php laravel unit-testing testing phpunit

每当我测试的端点尝试发送电子邮件时,我都会在http测试时收到错误响应。

public function testBasicTest()   {     $ faker = \ Faker \ Factory :: create();

http测试

$response = $this->json('POST', 'api/customRegister',
  [
    'name' => $faker->name,
    'email' => $faker->unique()->email,
    'password' => $faker->password
]);

error_log(json_encode($response->original,true));

$response->assertStatus(200);

}

端点

$when = Carbon\Carbon::now()->addMinutes(1);

   \Mail::to($user)->later($when, new EmailConfirmation($user));
   \Mail::to('connorlloydmoore@gmail.com')->later($when, new EmailConfirmation($user));

这是我必须在回复中继续进行的

  

ords exception-message \“\ u003EWhoops,看起来像是什么了   错。\ u003C / H1 \ u003E \ n

0 个答案:

没有答案