示例#1
0
 private function createUser()
 {
     $adminUser = new User();
     $adminUser->setUsername('webo');
     $adminUser->setEmail('*****@*****.**');
     $adminUser->setPlainPassword('weboDemo32');
     $adminUser->setEnabled(true);
     $adminUser->setRoles(array('ROLE_SUPER_ADMIN'));
     return $adminUser;
 }
示例#2
0
 private function createUser()
 {
     $riaUser = new User();
     $riaUser->setUsername('ria');
     $riaUser->setEmail('*****@*****.**');
     $riaUser->setPlainPassword('ria');
     $riaUser->setEnabled(true);
     $riaUser->setRoles(array('ROLE_RIA'));
     $riaUserProfile = new Profile();
     $riaUserProfile->setUser($riaUser);
     $riaUserProfile->setCompany('Wealthbot');
     $riaUserProfile->setFirstName('RiaFirst');
     $riaUserProfile->setLastName('RiaLast');
     $riaUserProfile->setRegistrationStep(5);
     $riaUser->setProfile($riaUserProfile);
     return $riaUser;
 }
示例#3
0
 public function setUp()
 {
     $questions = array();
     for ($i = 0; $i < 4; $i++) {
         $question = new RiskQuestion();
         $question->setTitle('Question ' . ($i + 1));
         for ($j = 0; $j < 4; $j++) {
             $answer = new RiskAnswer();
             $answer->setTitle('Answer ' . ($i + 1) . ' - ' . ($j + 1));
             $answer->setQuestion($question);
             $answer->setPoint($j);
             $question->addAnswer($answer);
         }
         $questions[] = $question;
     }
     $userAnswers = array();
     foreach ($questions as $key => $question) {
         $userAnswer = new ClientQuestionnaireAnswer();
         $userAnswer->setQuestion($question);
         $questionAnswers = $question->getAnswers();
         $userAnswer->setAnswer($questionAnswers[$key]);
         $userAnswers[] = $userAnswer;
     }
     $portfolio = new CeModel();
     for ($i = 0; $i < 4; $i++) {
         $modelMock = $this->getMock('Wealthbot\\AdminBundle\\Entity\\CeModel', array('getId'));
         $modelMock->expects($this->any())->method('getId')->will($this->returnValue($i + 1));
         $modelMock->setName('Model ' . ($i + 1));
         $modelMock->setRiskRating($i + 1);
         $portfolio->addChildren($modelMock);
     }
     $riaCompanyInformation = new RiaCompanyInformation();
     $riaCompanyInformation->setPortfolioModel($portfolio);
     $ria = new User();
     $ria->setRoles(array('ROLE_RIA'));
     $ria->setRiaCompanyInformation($riaCompanyInformation);
     $userProfile = new Profile();
     $userProfile->setRia($ria);
     $user = new User();
     $user->setRoles(array('ROLE_CLIENT'));
     $user->setProfile($userProfile);
     $this->riskTolerance = new RiskTolerance($user, $userAnswers);
 }
示例#4
0
 private function createUser(User $riaUser)
 {
     $clientUser = new User();
     $clientUser->setUsername('client');
     $clientUser->setEmail('*****@*****.**');
     $clientUser->setPlainPassword('client');
     $clientUser->setEnabled(true);
     $clientUser->setRoles(array('ROLE_CLIENT'));
     $clientUserProfile = new Profile();
     $clientUserProfile->setUser($clientUser);
     $clientUserProfile->setFirstName('ClientFirst');
     $clientUserProfile->setLastName('ClientLast');
     $clientUserProfile->setMiddleName('C');
     $clientUserProfile->setRegistrationStep(3);
     $clientUserProfile->setRia($riaUser);
     $clientUserProfile->setStatusProspect();
     $clientUser->setProfile($clientUserProfile);
     $clientSettings = new ClientSettings();
     $clientUser->setClientSettings($clientSettings);
     $clientSettings->setClient($clientUser);
     return $clientUser;
 }
示例#5
0
 private function createClientUser(array $data, User $riaUser)
 {
     $clientUser = new User();
     $clientUser->setUsername($data['username']);
     $clientUser->setEmail($data['username']);
     $clientUser->setPlainPassword($data['password']);
     $clientUser->setEnabled(true);
     $clientUser->setRoles(array('ROLE_CLIENT'));
     $clientUserProfile = new Profile();
     $clientUserProfile->setUser($clientUser);
     $clientUserProfile->setRia($riaUser);
     $clientUserProfile->setFirstName($data['first_name']);
     $clientUserProfile->setLastName($data['last_name']);
     $clientUserProfile->setState($this->getReference('state-' . $data['state']));
     $clientUserProfile->setStreet($data['street']);
     $clientUserProfile->setCity($data['city']);
     $clientUserProfile->setZip($data['zip']);
     $clientUserProfile->setBirthDate(new \DateTime($data['birth_date']));
     $clientUserProfile->setPhoneNumber($data['phone_number']);
     $clientUserProfile->setMaritalStatus($data['marital_status']);
     $clientUserProfile->setAnnualIncome($data['annual_income']);
     $clientUserProfile->setEstimatedIncomeTax($data['estimated_income_tax']);
     $clientUserProfile->setLiquidNetWorth($data['liquid_net_worth']);
     $clientUserProfile->setEmploymentType($data['employment_type']);
     $clientUserProfile->setClientAccountManaged($data['client_account_managed']);
     $clientUserProfile->setRegistrationStep($data['registration_step']);
     $clientSettings = new ClientSettings();
     $clientSettings->setStopTlhValue($data['stop_tlh_value']);
     $clientUser->setClientSettings($clientSettings);
     $clientSettings->setClient($clientUser);
     //$clientUserProfile->setSuggestedPortfolio($this->getReference('cec-ria-model-' . $data['suggested_portfolio_index']));
     if (isset($data['client_status'])) {
         $clientUserProfile->setClientStatus($data['client_status']);
     }
     $clientUser->setProfile($clientUserProfile);
     if (isset($data['created'])) {
         $createdAt = new \DateTime($data['created']);
         $clientUser->setCreated($createdAt);
     }
     if (isset($data['paymentMethod'])) {
         $clientUser->getProfile()->setPaymentMethod($data['paymentMethod']);
     }
     return $clientUser;
 }