function it_handles(UserUrlGenerator $urlGenerator, UserMailableFactory $mailableFactory)
 {
     $domainEvent = new UserRememberPasswordRequested(new UserId(), new UserEmail('*****@*****.**'), new UserToken('remember-token'));
     $mailable = new UserMailable(new UserEmail('*****@*****.**'), new UserEmail('*****@*****.**'), 'Dummy mail', 'Dummy mail body text');
     $urlGenerator->generate('bengor_user_user_change_password', Argument::type('array'))->shouldBeCalled()->willReturn('bengor.user.com/user/change-password');
     $mailableFactory->build('*****@*****.**', Argument::type('array'))->shouldBeCalled()->willReturn($mailable);
     $this->handle($domainEvent);
 }
 function it_handles(UserUrlGenerator $urlGenerator, UserMailableFactory $mailableFactory)
 {
     $domainEvent = new UserInvited(new UserId(), new UserEmail('*****@*****.**'), new UserToken('invitation-token'));
     $mailable = new UserMailable(new UserEmail('*****@*****.**'), new UserEmail('*****@*****.**'), 'Dummy mail', 'Dummy mail body text');
     $urlGenerator->generate('bengor_user_user_sign_up', Argument::type('array'))->shouldBeCalled()->willReturn('bengor.user.com/user/sign-up');
     $mailableFactory->build('*****@*****.**', Argument::type('array'))->shouldBeCalled()->willReturn($mailable);
     $this->handle($domainEvent);
 }
 /**
  * {@inheritdoc}
  */
 public function handle(UserEvent $anEvent)
 {
     $url = $this->urlGenerator->generate($this->route, ['remember-password-token' => $anEvent->rememberPasswordToken()->token()]);
     $mail = $this->mailableFactory->build($anEvent->email(), ['email' => $anEvent->email(), 'url' => $url]);
     $this->mailer->mail($mail);
 }
 /**
  * {@inheritdoc}
  */
 public function handle(UserEvent $anEvent)
 {
     $url = $this->urlGenerator->generate($this->route, ['confirmation-token' => $anEvent->confirmationToken()->token()]);
     $mail = $this->mailableFactory->build($anEvent->email(), ['email' => $anEvent->email(), 'url' => $url]);
     $this->mailer->mail($mail);
 }