private function createUser() { $this->testIfEmailAlreadyInUse(); $this->testIfUsernameAlreadyInUse(); $this->populateUserWithSubmitedDatas(); $modelErrors = $this->sfValidator->validate($this->newUser); if (count($modelErrors)) { throw new \Exception(json_encode($modelErrors), 400); } // $this->dispatcher->dispatch(SfynxCmfEvents::REGISTRATION_WS_SUCCESS, new UserEvent($this->newUser, $this->request)); // $this->userManager->updateUser($this->newUser); if ($this->mailer) { $this->mailer->sendConfirmationEmailMessage($this->newUser); } }
/** * @test */ public function sendWorks() { $this->mailer->expects($this->once())->method('send'); $this->controller->mailIt(); }
/** * @param MailerInterface $mailer * @return bool */ public function handle(MailerInterface $mailer) { $mailer->setData($this->data); $mailer->send(); }
/** * @param $name * @param $arguments * @return MailerInterface */ public function __call($name, $arguments) { return method_exists($this->mailer, $name) ? call_user_func_array([$this->mailer, $name], $arguments) : call_user_func_array([$this->mailer->getMail(), $name], $arguments); }