public function testSend() { $this->event->expects($this->once())->method('getUser')->willReturn($this->user); $this->event->expects($this->once())->method('getToken')->willReturn('test_token'); \Mail::shouldReceive('send')->once(); $this->listener->handle($this->event); }
public function handle(UserHasRecoveredPassword $event) { $user = $event->getUser(); $token = $event->getToken(); Mail::send('emails.user_password_recovery', ['user' => $user, 'token' => $token], function (Message $m) use($user) { $m->to($user->email, $user->name)->subject('Scelta Nuova Password :: Laravel-Italia.it'); }); }