コード例 #1
0
 protected function insertLogin($strLogin, $strNovaSenha)
 {
     $serviceManager = Bootstrap::getServiceManager();
     $serviceConfiguracaoEmail = $serviceManager->get('Mensageria\\Service\\ConfiguracaoEmail');
     $serviceConfiguracaoEmail->save(array('dsComplemento' => String::generateRandomExpression(5), 'dsEmail' => String::generateRandomExpression(5), 'dsPassword' => String::generateRandomExpression(5), 'dsSmtp' => String::generateRandomExpression(5), 'dsUsuario' => String::generateRandomExpression(5)));
     $arrDataPessoa = array('dsEmail' => $strLogin, 'dsNome' => $strLogin, 'dsCpf' => '11111111111', 'datAniversario' => date('d/m/Y'), 'dsLogin' => $strLogin, 'idPessoaFisica' => null);
     $pessoaFisica = $serviceManager->get('Pessoa\\Service\\PessoaFisica')->save($arrDataPessoa);
     $serviceManager->get('Authentication\\Service\\Authentication')->alterarSenha($pessoaFisica->getIdPessoaFisica(), $strNovaSenha);
 }
コード例 #2
0
 protected function getCadastroPessoaFisica()
 {
     if (self::$pessoaFisica) {
         return self::$pessoaFisica;
     }
     $serviceManager = Bootstrap::getServiceManager();
     $strEmail = String::generateRandomExpression(10) . '@gmail.com';
     $pessoaFisica = $serviceManager->get('Pessoa\\Service\\PessoaFisica')->save(array('dsEmail' => $strEmail, 'dsNome' => String::generateRandomExpression(255), 'dsCpf' => GenerateTest::cpfRandom(), 'dsLogin' => null, 'datAniversario' => date('d/m/Y'), 'idPessoaFisica' => null));
     self::$pessoaFisica = $pessoaFisica;
     return self::$pessoaFisica;
 }
コード例 #3
0
ファイル: PessoaFisica.php プロジェクト: ualisonaguiar/shome2
 /**
  * Metodo responsavel para realizar operacoes apos de salvar.
  *
  * @param type $arrData
  * @param type $pessoaFisica
  */
 protected function posSave($arrData, PessoaFisicaEntity $pessoaFisica)
 {
     # Salvando informacao do login
     if ($arrData['dsLogin']) {
         $serviceLogin = $this->getService('Authentication\\Service\\Authentication');
         $arrDataLoginSave = $serviceLogin->findBy(array('idPessoaFisica' => $pessoaFisica->getIdPessoaFisica()));
         if ($arrDataLoginSave) {
             return $arrDataLoginSave;
         }
         $arrDataLogin = array('dsLogin' => $arrData['dsLogin'], 'dsPassword' => String::generateRandomExpression(8, true), 'idPessoaFisica' => $pessoaFisica->getIdPessoaFisica());
         $serviceLogin->save($arrDataLogin);
         $strTexto = $serviceLogin->getTextCadastroLogin($pessoaFisica->getDsNome(), $arrDataLogin['dsLogin'], $arrDataLogin['dsPassword']);
         return $this->registroEnvioEmail($pessoaFisica, 'SHOME2 :: Cadastro de Usuário', $strTexto);
     }
     return false;
 }
コード例 #4
0
 /**
  * @test
  * @covers \Perfil\Controller\IndexController::ajaxAlterarSituacaoAction()
  * @depends addActionPost
  */
 public function ajaxAlterarSituacaoPost()
 {
     Bootstrap::getServiceManager()->get('Doctrine\\ORM\\EntityManager')->getConnection()->beginTransaction();
     $serviceManager = Bootstrap::getServiceManager();
     $servicePerfil = $serviceManager->get('Perfil\\Service\\Perfil');
     $perfil = $servicePerfil->save(array('noPerfil' => String::generateRandomExpression(255), 'dsPerfil' => String::generateRandomExpression(255), 'idPerfil' => ''));
     $parameter = new Parameters(array('idPerfil' => $perfil->getIdPerfil()));
     $this->getRequest()->setMethod('POST');
     $this->getRequest()->setPost($parameter);
     $this->dispatch('/perfil/ajaxAlterarSituacao');
     $this->assertResponseStatusCode(200);
     Bootstrap::getServiceManager()->get('Doctrine\\ORM\\EntityManager')->getConnection()->rollback();
 }
コード例 #5
0
 public function getListInformationInvalid()
 {
     return array(array(GenerateTest::cnpjRandom(), String::generateRandomExpression(10) . '@gmail.com'), array(GenerateTest::cnpjRandom(true), String::generateRandomExpression(10) . '@gmail.com'));
 }
コード例 #6
0
ファイル: PessoaTest.php プロジェクト: ualisonaguiar/shome2
 /**
  *
  * @return type
  */
 public function getDadosPessoaValido()
 {
     $serviceManager = Bootstrap::getServiceManager();
     $serviceConfiguracaoEmail = $serviceManager->get('Mensageria\\Service\\ConfiguracaoEmail');
     $serviceConfiguracaoEmail->save(array('dsComplemento' => String::generateRandomExpression(5), 'dsEmail' => String::generateRandomExpression(5), 'dsPassword' => String::generateRandomExpression(5), 'dsSmtp' => String::generateRandomExpression(5), 'dsUsuario' => String::generateRandomExpression(5)));
     return array(array(array('dsEmail' => String::generateRandomExpression(100) . '@gmail.com', 'dsNome' => String::generateRandomExpression(255), 'dsCpf' => GenerateTest::cpfRandom(), 'datAniversario' => date('d/m/Y'), 'dsLogin' => GenerateTest::cpfRandom(), 'idPessoaFisica' => null)));
 }