From 0e7f0a709633204ccb9312486e5edf6166366509 Mon Sep 17 00:00:00 2001 From: Paul Richard <36829911+NinetiesPaul@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:22:45 -0300 Subject: [PATCH] 560 refatoracao de testes (#578) * feat: refatorado testes no ambiente sei4 * feat: refatorado testes no ambiente sei41 * feat: refatorado testes no ambiente super --------- Co-authored-by: Paul Richard Pereira Martins dos Anjos --- .../tests/FixtureCenarioBaseTestCase.php | 17 +++++++++++++- .../TramiteProcessoComCancelamentoTest.php | 23 ++++--------------- ...teProcessoComDevolucaoAlteracaoURLTest.php | 10 ++++---- .../tests/TramiteProcessoComDevolucaoTest.php | 7 +++--- ...ocessoComDevolucaoUnidadeDiferenteTest.php | 7 +++--- ...ComDocumentoRestritoHipotesePadraoTest.php | 22 ++++-------------- .../tests/TramiteProcessoComHistoricoTest.php | 4 ++-- ...ntendoDocumentoCanceladoSemTamanhoTest.php | 14 ++++++----- .../tests/FixtureCenarioBaseTestCase.php | 17 +++++++++++++- .../TramiteProcessoComCancelamentoTest.php | 23 ++++--------------- ...teProcessoComDevolucaoAlteracaoURLTest.php | 10 ++++---- .../tests/TramiteProcessoComDevolucaoTest.php | 7 +++--- ...ocessoComDevolucaoUnidadeDiferenteTest.php | 7 +++--- ...ComDocumentoRestritoHipotesePadraoTest.php | 22 ++++-------------- .../tests/TramiteProcessoComHistoricoTest.php | 4 ++-- ...ntendoDocumentoCanceladoSemTamanhoTest.php | 14 ++++++----- .../tests/FixtureCenarioBaseTestCase.php | 17 +++++++++++++- .../TramiteProcessoComCancelamentoTest.php | 23 ++++--------------- ...teProcessoComDevolucaoAlteracaoURLTest.php | 10 ++++---- .../tests/TramiteProcessoComDevolucaoTest.php | 7 +++--- ...ocessoComDevolucaoUnidadeDiferenteTest.php | 7 +++--- ...ComDocumentoRestritoHipotesePadraoTest.php | 22 ++++-------------- .../tests/TramiteProcessoComHistoricoTest.php | 4 ++-- ...ntendoDocumentoCanceladoSemTamanhoTest.php | 21 +++++++++-------- 24 files changed, 150 insertions(+), 169 deletions(-) diff --git a/tests_sei4/funcional/tests/FixtureCenarioBaseTestCase.php b/tests_sei4/funcional/tests/FixtureCenarioBaseTestCase.php index 2fce72abe..fcb43c161 100755 --- a/tests_sei4/funcional/tests/FixtureCenarioBaseTestCase.php +++ b/tests_sei4/funcional/tests/FixtureCenarioBaseTestCase.php @@ -48,7 +48,8 @@ protected function cadastrarProcessoFixture(&$dadosProcesso) $objProtocoloAssuntoFixture = new RelProtocoloAssuntoFixture(); $objProtocoloAssuntoFixture->carregar([ - 'IdProtocolo' => $objProtocoloDTO->getDblIdProtocolo() + 'IdProtocolo' => $objProtocoloDTO->getDblIdProtocolo(), + 'IdAssunto' => 377 ]); $objAtributoAndamentoFixture = new AtributoAndamentoFixture(); @@ -100,6 +101,20 @@ protected function cadastrarDocumentoExternoFixture($dadosDocumentoExterno, $idP 'IdProtocolo' => $objDocumentoDTO->getDblIdDocumento(), 'Nome' => basename($dadosDocumentoExterno['ARQUIVO']), ]); + + $objAtividadeFixture = new AtividadeFixture(); + $objAtividadeDTO = $objAtividadeFixture->carregar([ + 'IdProtocolo' => $idProtocolo, + 'Conclusao' => \InfraData::getStrDataHoraAtual(), + 'IdTarefa' => \TarefaRN::$TI_ARQUIVO_ANEXADO, + 'IdUsuarioConclusao' => 100000001 + ]); + + $objAtributoAndamentoFixture = new AtributoAndamentoFixture(); + $objAtributoAndamentoFixture->carregar([ + 'IdAtividade' => $objAtividadeDTO->getNumIdAtividade(), + 'Nome' => 'ANEXO' + ]); return $objDocumentoDTO; } diff --git a/tests_sei4/funcional/tests/TramiteProcessoComCancelamentoTest.php b/tests_sei4/funcional/tests/TramiteProcessoComCancelamentoTest.php index aa8c96d79..a70cc9b58 100755 --- a/tests_sei4/funcional/tests/TramiteProcessoComCancelamentoTest.php +++ b/tests_sei4/funcional/tests/TramiteProcessoComCancelamentoTest.php @@ -6,7 +6,7 @@ * Execution Groups * @group execute_without_receiving */ -class TramiteProcessoComCancelamentoTest extends CenarioBaseTestCase +class TramiteProcessoComCancelamentoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -32,15 +32,8 @@ public function test_cancelamento_tramite_contendo_documento_interno() self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste = $this->gerarDadosDocumentoInternoTeste(self::$remetente); - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - $this->cadastrarDocumentoInterno(self::$documentoTeste); - $this->assinarDocumento(self::$remetente['ORGAO'], self::$remetente['CARGO_ASSINATURA'], self::$remetente['SENHA']); - - $this->tramitarProcessoExternamente( - self::$protocoloTeste, self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'], - self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false - ); + $this->realizarTramiteExternoSemvalidacaoNoRemetenteFixture(self::$processoTeste, self::$documentoTeste, self::$remetente, self::$destinatario); + self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; $this->paginaProcesso->cancelarTramitacaoExterna(); $mensagemAlerta = $this->paginaTramitar->alertTextAndClose(true); @@ -95,14 +88,8 @@ public function test_cancelamento_tramite_contendo_documento_externo() self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste = $this->gerarDadosDocumentoExternoTeste(self::$remetente, 'arquivo_001.pdf'); - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - $this->cadastrarDocumentoExterno(self::$documentoTeste); - - $this->tramitarProcessoExternamente( - self::$protocoloTeste, self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'], - self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false - ); + $this->realizarTramiteExternoSemvalidacaoNoRemetenteFixture(self::$processoTeste, self::$documentoTeste, self::$remetente, self::$destinatario); + self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; $this->paginaProcesso->cancelarTramitacaoExterna(); $mensagemAlerta = $this->paginaTramitar->alertTextAndClose(true); diff --git a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php index 097b5295d..9b0848036 100755 --- a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php +++ b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php @@ -4,7 +4,7 @@ * Execution Groups * @group execute_alone_group3 */ -class TramiteProcessoComDevolucaoAlteracaoURLTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoAlteracaoURLTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -58,7 +58,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste1 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } @@ -98,7 +98,8 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste3 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); $documentos = array(self::$documentoTeste3); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + putenv("DATABASE_HOST=org2-database"); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } @@ -136,6 +137,7 @@ public function test_tramitar_processo_da_origem_novo_url() self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_A); self::$destinatario = $this->definirContextoTeste(CONTEXTO_ORGAO_B); self::$documentoTeste5 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); + putenv("DATABASE_HOST=org1-database"); $bancoOrgaoA = new DatabaseUtils(CONTEXTO_ORGAO_A); $result=$bancoOrgaoA->query("SELECT texto FROM tarja_assinatura where sta_tarja_assinatura=? and sin_ativo=?", array("V","S")); @@ -154,7 +156,7 @@ public function test_tramitar_processo_da_origem_novo_url() $bancoOrgaoA->execute("update tarja_assinatura set texto=? where sta_tarja_assinatura=? and sin_ativo=?", array($strTarja,"V","S")); $documentos = array(self::$documentoTeste5); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } diff --git a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoTest.php b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoTest.php index db71d4b6c..a1c428bc6 100755 --- a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoTest.php +++ b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoTest.php @@ -5,7 +5,7 @@ * Execution Groups * @group execute_alone_group6 */ -class TramiteProcessoComDevolucaoTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -36,7 +36,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } @@ -77,7 +77,8 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste4 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste3, self::$documentoTeste4); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + putenv("DATABASE_HOST=org2-database"); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } diff --git a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php index 176c258ca..e96fb4943 100755 --- a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php +++ b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php @@ -5,7 +5,7 @@ * Execution Groups * @group execute_alone_group3 */ -class TramiteProcessoComDevolucaoUnidadeDiferenteTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoUnidadeDiferenteTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -36,7 +36,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } @@ -82,7 +82,8 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste4 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste3, self::$documentoTeste4); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + putenv("DATABASE_HOST=org2-database"); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } diff --git a/tests_sei4/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php b/tests_sei4/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php index a3266fab3..8920dc732 100755 --- a/tests_sei4/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php +++ b/tests_sei4/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php @@ -4,7 +4,7 @@ * Execution Groups * @group execute_alone_group2 */ -class TramiteProcessoComDocumentoRestritoHipotesePadraoTest extends CenarioBaseTestCase +class TramiteProcessoComDocumentoRestritoHipotesePadraoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -30,26 +30,12 @@ public function test_tramitar_processo_com_documento_restrito_hipotese_nao_mapea self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste = $this->gerarDadosDocumentoInternoTeste(self::$remetente); - // Acessar sistema do this->REMETENTE do processo - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - - // Cadastrar novo processo de teste - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - // Configuração de documento restrito self::$documentoTeste["RESTRICAO"] = PaginaIncluirDocumento::STA_NIVEL_ACESSO_RESTRITO; self::$documentoTeste["HIPOTESE_LEGAL"] = self::$remetente["HIPOTESE_RESTRICAO_NAO_MAPEADO"]; - - // Incluir Documentos no Processo - $this->cadastrarDocumentoInterno(self::$documentoTeste); - - // Assinar documento interno criado anteriormente - $this->assinarDocumento(self::$remetente['ORGAO'], self::$remetente['CARGO_ASSINATURA'], self::$remetente['SENHA']); - - // Trâmitar Externamento processo para órgão/unidade destinatária - $this->tramitarProcessoExternamente( - self::$protocoloTeste, self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'], - self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false); + + $this->realizarTramiteExternoSemvalidacaoNoRemetenteFixture(self::$processoTeste, self::$documentoTeste, self::$remetente, self::$destinatario); + self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } diff --git a/tests_sei4/funcional/tests/TramiteProcessoComHistoricoTest.php b/tests_sei4/funcional/tests/TramiteProcessoComHistoricoTest.php index 1a2f355b5..954410468 100755 --- a/tests_sei4/funcional/tests/TramiteProcessoComHistoricoTest.php +++ b/tests_sei4/funcional/tests/TramiteProcessoComHistoricoTest.php @@ -4,7 +4,7 @@ * Execution Groups * @group execute_parallel_group3 */ -class TramiteProcessoComHistoricoTest extends CenarioBaseTestCase +class TramiteProcessoComHistoricoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -32,7 +32,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } diff --git a/tests_sei4/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php b/tests_sei4/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php index 0cd4130d3..632b32a59 100755 --- a/tests_sei4/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php +++ b/tests_sei4/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php @@ -9,7 +9,7 @@ * Execution Groups * @group execute_parallel_group1 */ -class TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest extends CenarioBaseTestCase +class TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -37,16 +37,18 @@ public function test_tramitar_processo_contendo_documento_cancelado() self::$documentoTeste1 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); + $objProtocoloPrincipalDTO = $this->cadastrarProcessoFixture(self::$processoTeste); + + $this->cadastrarDocumentoExternoFixture(self::$documentoTeste1, $objProtocoloPrincipalDTO->getDblIdProtocolo()); + self::$protocoloTeste = $objProtocoloPrincipalDTO->getStrProtocoloFormatado(); + // Acessar sistema do this->REMETENTE do processo $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - // Cadastrar novo processo de teste e incluir documentos relacionados - $this->paginaBase->navegarParaControleProcesso(); - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - $this->cadastrarDocumentoExterno(self::$documentoTeste1); + $this->abrirProcesso(self::$protocoloTeste); //Tramitar internamento para liberação da funcionalidade de cancelar - $this->tramitarProcessoInternamenteParaCancelamento(self::$remetente['SIGLA_UNIDADE'], self::$remetente['SIGLA_UNIDADE_SECUNDARIA'], self::$processoTeste); + $this->tramitarProcessoInternamenteParaCancelamento(self::$remetente['SIGLA_UNIDADE'], self::$remetente['SIGLA_UNIDADE_SECUNDARIA'], [ 'PROTOCOLO' => self::$protocoloTeste ]); $this->navegarParaCancelarDocumento(0); $this->paginaCancelarDocumento->cancelar("Motivo de teste"); diff --git a/tests_sei41/funcional/tests/FixtureCenarioBaseTestCase.php b/tests_sei41/funcional/tests/FixtureCenarioBaseTestCase.php index 2fce72abe..fcb43c161 100755 --- a/tests_sei41/funcional/tests/FixtureCenarioBaseTestCase.php +++ b/tests_sei41/funcional/tests/FixtureCenarioBaseTestCase.php @@ -48,7 +48,8 @@ protected function cadastrarProcessoFixture(&$dadosProcesso) $objProtocoloAssuntoFixture = new RelProtocoloAssuntoFixture(); $objProtocoloAssuntoFixture->carregar([ - 'IdProtocolo' => $objProtocoloDTO->getDblIdProtocolo() + 'IdProtocolo' => $objProtocoloDTO->getDblIdProtocolo(), + 'IdAssunto' => 377 ]); $objAtributoAndamentoFixture = new AtributoAndamentoFixture(); @@ -100,6 +101,20 @@ protected function cadastrarDocumentoExternoFixture($dadosDocumentoExterno, $idP 'IdProtocolo' => $objDocumentoDTO->getDblIdDocumento(), 'Nome' => basename($dadosDocumentoExterno['ARQUIVO']), ]); + + $objAtividadeFixture = new AtividadeFixture(); + $objAtividadeDTO = $objAtividadeFixture->carregar([ + 'IdProtocolo' => $idProtocolo, + 'Conclusao' => \InfraData::getStrDataHoraAtual(), + 'IdTarefa' => \TarefaRN::$TI_ARQUIVO_ANEXADO, + 'IdUsuarioConclusao' => 100000001 + ]); + + $objAtributoAndamentoFixture = new AtributoAndamentoFixture(); + $objAtributoAndamentoFixture->carregar([ + 'IdAtividade' => $objAtividadeDTO->getNumIdAtividade(), + 'Nome' => 'ANEXO' + ]); return $objDocumentoDTO; } diff --git a/tests_sei41/funcional/tests/TramiteProcessoComCancelamentoTest.php b/tests_sei41/funcional/tests/TramiteProcessoComCancelamentoTest.php index aa8c96d79..a70cc9b58 100755 --- a/tests_sei41/funcional/tests/TramiteProcessoComCancelamentoTest.php +++ b/tests_sei41/funcional/tests/TramiteProcessoComCancelamentoTest.php @@ -6,7 +6,7 @@ * Execution Groups * @group execute_without_receiving */ -class TramiteProcessoComCancelamentoTest extends CenarioBaseTestCase +class TramiteProcessoComCancelamentoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -32,15 +32,8 @@ public function test_cancelamento_tramite_contendo_documento_interno() self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste = $this->gerarDadosDocumentoInternoTeste(self::$remetente); - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - $this->cadastrarDocumentoInterno(self::$documentoTeste); - $this->assinarDocumento(self::$remetente['ORGAO'], self::$remetente['CARGO_ASSINATURA'], self::$remetente['SENHA']); - - $this->tramitarProcessoExternamente( - self::$protocoloTeste, self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'], - self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false - ); + $this->realizarTramiteExternoSemvalidacaoNoRemetenteFixture(self::$processoTeste, self::$documentoTeste, self::$remetente, self::$destinatario); + self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; $this->paginaProcesso->cancelarTramitacaoExterna(); $mensagemAlerta = $this->paginaTramitar->alertTextAndClose(true); @@ -95,14 +88,8 @@ public function test_cancelamento_tramite_contendo_documento_externo() self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste = $this->gerarDadosDocumentoExternoTeste(self::$remetente, 'arquivo_001.pdf'); - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - $this->cadastrarDocumentoExterno(self::$documentoTeste); - - $this->tramitarProcessoExternamente( - self::$protocoloTeste, self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'], - self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false - ); + $this->realizarTramiteExternoSemvalidacaoNoRemetenteFixture(self::$processoTeste, self::$documentoTeste, self::$remetente, self::$destinatario); + self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; $this->paginaProcesso->cancelarTramitacaoExterna(); $mensagemAlerta = $this->paginaTramitar->alertTextAndClose(true); diff --git a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php index 097b5295d..9b0848036 100755 --- a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php +++ b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php @@ -4,7 +4,7 @@ * Execution Groups * @group execute_alone_group3 */ -class TramiteProcessoComDevolucaoAlteracaoURLTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoAlteracaoURLTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -58,7 +58,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste1 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } @@ -98,7 +98,8 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste3 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); $documentos = array(self::$documentoTeste3); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + putenv("DATABASE_HOST=org2-database"); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } @@ -136,6 +137,7 @@ public function test_tramitar_processo_da_origem_novo_url() self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_A); self::$destinatario = $this->definirContextoTeste(CONTEXTO_ORGAO_B); self::$documentoTeste5 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); + putenv("DATABASE_HOST=org1-database"); $bancoOrgaoA = new DatabaseUtils(CONTEXTO_ORGAO_A); $result=$bancoOrgaoA->query("SELECT texto FROM tarja_assinatura where sta_tarja_assinatura=? and sin_ativo=?", array("V","S")); @@ -154,7 +156,7 @@ public function test_tramitar_processo_da_origem_novo_url() $bancoOrgaoA->execute("update tarja_assinatura set texto=? where sta_tarja_assinatura=? and sin_ativo=?", array($strTarja,"V","S")); $documentos = array(self::$documentoTeste5); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } diff --git a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoTest.php b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoTest.php index db71d4b6c..a1c428bc6 100755 --- a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoTest.php +++ b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoTest.php @@ -5,7 +5,7 @@ * Execution Groups * @group execute_alone_group6 */ -class TramiteProcessoComDevolucaoTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -36,7 +36,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } @@ -77,7 +77,8 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste4 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste3, self::$documentoTeste4); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + putenv("DATABASE_HOST=org2-database"); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } diff --git a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php index 176c258ca..e96fb4943 100755 --- a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php +++ b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php @@ -5,7 +5,7 @@ * Execution Groups * @group execute_alone_group3 */ -class TramiteProcessoComDevolucaoUnidadeDiferenteTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoUnidadeDiferenteTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -36,7 +36,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } @@ -82,7 +82,8 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste4 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste3, self::$documentoTeste4); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + putenv("DATABASE_HOST=org2-database"); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } diff --git a/tests_sei41/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php b/tests_sei41/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php index a3266fab3..d7c8d4b65 100755 --- a/tests_sei41/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php +++ b/tests_sei41/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php @@ -4,7 +4,7 @@ * Execution Groups * @group execute_alone_group2 */ -class TramiteProcessoComDocumentoRestritoHipotesePadraoTest extends CenarioBaseTestCase +class TramiteProcessoComDocumentoRestritoHipotesePadraoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -30,26 +30,12 @@ public function test_tramitar_processo_com_documento_restrito_hipotese_nao_mapea self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste = $this->gerarDadosDocumentoInternoTeste(self::$remetente); - // Acessar sistema do this->REMETENTE do processo - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - - // Cadastrar novo processo de teste - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - // Configuração de documento restrito self::$documentoTeste["RESTRICAO"] = PaginaIncluirDocumento::STA_NIVEL_ACESSO_RESTRITO; self::$documentoTeste["HIPOTESE_LEGAL"] = self::$remetente["HIPOTESE_RESTRICAO_NAO_MAPEADO"]; - - // Incluir Documentos no Processo - $this->cadastrarDocumentoInterno(self::$documentoTeste); - - // Assinar documento interno criado anteriormente - $this->assinarDocumento(self::$remetente['ORGAO'], self::$remetente['CARGO_ASSINATURA'], self::$remetente['SENHA']); - - // Trâmitar Externamento processo para órgão/unidade destinatária - $this->tramitarProcessoExternamente( - self::$protocoloTeste, self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'], - self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false); + + $this->realizarTramiteExternoSemvalidacaoNoRemetenteFixture(self::$processoTeste, self::$documentoTeste, self::$remetente, self::$destinatario); + self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } diff --git a/tests_sei41/funcional/tests/TramiteProcessoComHistoricoTest.php b/tests_sei41/funcional/tests/TramiteProcessoComHistoricoTest.php index 1a2f355b5..954410468 100755 --- a/tests_sei41/funcional/tests/TramiteProcessoComHistoricoTest.php +++ b/tests_sei41/funcional/tests/TramiteProcessoComHistoricoTest.php @@ -4,7 +4,7 @@ * Execution Groups * @group execute_parallel_group3 */ -class TramiteProcessoComHistoricoTest extends CenarioBaseTestCase +class TramiteProcessoComHistoricoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -32,7 +32,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } diff --git a/tests_sei41/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php b/tests_sei41/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php index 0cd4130d3..632b32a59 100755 --- a/tests_sei41/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php +++ b/tests_sei41/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php @@ -9,7 +9,7 @@ * Execution Groups * @group execute_parallel_group1 */ -class TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest extends CenarioBaseTestCase +class TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -37,16 +37,18 @@ public function test_tramitar_processo_contendo_documento_cancelado() self::$documentoTeste1 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); + $objProtocoloPrincipalDTO = $this->cadastrarProcessoFixture(self::$processoTeste); + + $this->cadastrarDocumentoExternoFixture(self::$documentoTeste1, $objProtocoloPrincipalDTO->getDblIdProtocolo()); + self::$protocoloTeste = $objProtocoloPrincipalDTO->getStrProtocoloFormatado(); + // Acessar sistema do this->REMETENTE do processo $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - // Cadastrar novo processo de teste e incluir documentos relacionados - $this->paginaBase->navegarParaControleProcesso(); - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - $this->cadastrarDocumentoExterno(self::$documentoTeste1); + $this->abrirProcesso(self::$protocoloTeste); //Tramitar internamento para liberação da funcionalidade de cancelar - $this->tramitarProcessoInternamenteParaCancelamento(self::$remetente['SIGLA_UNIDADE'], self::$remetente['SIGLA_UNIDADE_SECUNDARIA'], self::$processoTeste); + $this->tramitarProcessoInternamenteParaCancelamento(self::$remetente['SIGLA_UNIDADE'], self::$remetente['SIGLA_UNIDADE_SECUNDARIA'], [ 'PROTOCOLO' => self::$protocoloTeste ]); $this->navegarParaCancelarDocumento(0); $this->paginaCancelarDocumento->cancelar("Motivo de teste"); diff --git a/tests_super/funcional/tests/FixtureCenarioBaseTestCase.php b/tests_super/funcional/tests/FixtureCenarioBaseTestCase.php index a64884498..51c1c6175 100755 --- a/tests_super/funcional/tests/FixtureCenarioBaseTestCase.php +++ b/tests_super/funcional/tests/FixtureCenarioBaseTestCase.php @@ -48,7 +48,8 @@ protected function cadastrarProcessoFixture(&$dadosProcesso) $objProtocoloAssuntoFixture = new RelProtocoloAssuntoFixture(); $objProtocoloAssuntoFixture->carregar([ - 'IdProtocolo' => $objProtocoloDTO->getDblIdProtocolo() + 'IdProtocolo' => $objProtocoloDTO->getDblIdProtocolo(), + 'IdAssunto' => 377 ]); $objAtributoAndamentoFixture = new AtributoAndamentoFixture(); @@ -100,6 +101,20 @@ protected function cadastrarDocumentoExternoFixture($dadosDocumentoExterno, $idP 'IdProtocolo' => $objDocumentoDTO->getDblIdDocumento(), 'Nome' => basename($dadosDocumentoExterno['ARQUIVO']), ]); + + $objAtividadeFixture = new AtividadeFixture(); + $objAtividadeDTO = $objAtividadeFixture->carregar([ + 'IdProtocolo' => $idProtocolo, + 'Conclusao' => \InfraData::getStrDataHoraAtual(), + 'IdTarefa' => \TarefaRN::$TI_ARQUIVO_ANEXADO, + 'IdUsuarioConclusao' => 100000001 + ]); + + $objAtributoAndamentoFixture = new AtributoAndamentoFixture(); + $objAtributoAndamentoFixture->carregar([ + 'IdAtividade' => $objAtividadeDTO->getNumIdAtividade(), + 'Nome' => 'ANEXO' + ]); return $objDocumentoDTO; } diff --git a/tests_super/funcional/tests/TramiteProcessoComCancelamentoTest.php b/tests_super/funcional/tests/TramiteProcessoComCancelamentoTest.php index aa8c96d79..a70cc9b58 100755 --- a/tests_super/funcional/tests/TramiteProcessoComCancelamentoTest.php +++ b/tests_super/funcional/tests/TramiteProcessoComCancelamentoTest.php @@ -6,7 +6,7 @@ * Execution Groups * @group execute_without_receiving */ -class TramiteProcessoComCancelamentoTest extends CenarioBaseTestCase +class TramiteProcessoComCancelamentoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -32,15 +32,8 @@ public function test_cancelamento_tramite_contendo_documento_interno() self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste = $this->gerarDadosDocumentoInternoTeste(self::$remetente); - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - $this->cadastrarDocumentoInterno(self::$documentoTeste); - $this->assinarDocumento(self::$remetente['ORGAO'], self::$remetente['CARGO_ASSINATURA'], self::$remetente['SENHA']); - - $this->tramitarProcessoExternamente( - self::$protocoloTeste, self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'], - self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false - ); + $this->realizarTramiteExternoSemvalidacaoNoRemetenteFixture(self::$processoTeste, self::$documentoTeste, self::$remetente, self::$destinatario); + self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; $this->paginaProcesso->cancelarTramitacaoExterna(); $mensagemAlerta = $this->paginaTramitar->alertTextAndClose(true); @@ -95,14 +88,8 @@ public function test_cancelamento_tramite_contendo_documento_externo() self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste = $this->gerarDadosDocumentoExternoTeste(self::$remetente, 'arquivo_001.pdf'); - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - $this->cadastrarDocumentoExterno(self::$documentoTeste); - - $this->tramitarProcessoExternamente( - self::$protocoloTeste, self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'], - self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false - ); + $this->realizarTramiteExternoSemvalidacaoNoRemetenteFixture(self::$processoTeste, self::$documentoTeste, self::$remetente, self::$destinatario); + self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; $this->paginaProcesso->cancelarTramitacaoExterna(); $mensagemAlerta = $this->paginaTramitar->alertTextAndClose(true); diff --git a/tests_super/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php b/tests_super/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php index 097b5295d..9b0848036 100755 --- a/tests_super/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php +++ b/tests_super/funcional/tests/TramiteProcessoComDevolucaoAlteracaoURLTest.php @@ -4,7 +4,7 @@ * Execution Groups * @group execute_alone_group3 */ -class TramiteProcessoComDevolucaoAlteracaoURLTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoAlteracaoURLTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -58,7 +58,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste1 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } @@ -98,7 +98,8 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste3 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); $documentos = array(self::$documentoTeste3); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + putenv("DATABASE_HOST=org2-database"); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } @@ -136,6 +137,7 @@ public function test_tramitar_processo_da_origem_novo_url() self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_A); self::$destinatario = $this->definirContextoTeste(CONTEXTO_ORGAO_B); self::$documentoTeste5 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); + putenv("DATABASE_HOST=org1-database"); $bancoOrgaoA = new DatabaseUtils(CONTEXTO_ORGAO_A); $result=$bancoOrgaoA->query("SELECT texto FROM tarja_assinatura where sta_tarja_assinatura=? and sin_ativo=?", array("V","S")); @@ -154,7 +156,7 @@ public function test_tramitar_processo_da_origem_novo_url() $bancoOrgaoA->execute("update tarja_assinatura set texto=? where sta_tarja_assinatura=? and sin_ativo=?", array($strTarja,"V","S")); $documentos = array(self::$documentoTeste5); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } diff --git a/tests_super/funcional/tests/TramiteProcessoComDevolucaoTest.php b/tests_super/funcional/tests/TramiteProcessoComDevolucaoTest.php index db71d4b6c..a1c428bc6 100755 --- a/tests_super/funcional/tests/TramiteProcessoComDevolucaoTest.php +++ b/tests_super/funcional/tests/TramiteProcessoComDevolucaoTest.php @@ -5,7 +5,7 @@ * Execution Groups * @group execute_alone_group6 */ -class TramiteProcessoComDevolucaoTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -36,7 +36,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } @@ -77,7 +77,8 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste4 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste3, self::$documentoTeste4); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + putenv("DATABASE_HOST=org2-database"); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } diff --git a/tests_super/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php b/tests_super/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php index ff2591961..cd147622c 100755 --- a/tests_super/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php +++ b/tests_super/funcional/tests/TramiteProcessoComDevolucaoUnidadeDiferenteTest.php @@ -5,7 +5,7 @@ * Execution Groups * @group execute_alone_group3 */ -class TramiteProcessoComDevolucaoUnidadeDiferenteTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoUnidadeDiferenteTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -36,7 +36,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } @@ -82,7 +82,8 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste4 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste3, self::$documentoTeste4); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + putenv("DATABASE_HOST=org2-database"); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } diff --git a/tests_super/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php b/tests_super/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php index a3266fab3..8920dc732 100755 --- a/tests_super/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php +++ b/tests_super/funcional/tests/TramiteProcessoComDocumentoRestritoHipotesePadraoTest.php @@ -4,7 +4,7 @@ * Execution Groups * @group execute_alone_group2 */ -class TramiteProcessoComDocumentoRestritoHipotesePadraoTest extends CenarioBaseTestCase +class TramiteProcessoComDocumentoRestritoHipotesePadraoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -30,26 +30,12 @@ public function test_tramitar_processo_com_documento_restrito_hipotese_nao_mapea self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste = $this->gerarDadosDocumentoInternoTeste(self::$remetente); - // Acessar sistema do this->REMETENTE do processo - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - - // Cadastrar novo processo de teste - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - // Configuração de documento restrito self::$documentoTeste["RESTRICAO"] = PaginaIncluirDocumento::STA_NIVEL_ACESSO_RESTRITO; self::$documentoTeste["HIPOTESE_LEGAL"] = self::$remetente["HIPOTESE_RESTRICAO_NAO_MAPEADO"]; - - // Incluir Documentos no Processo - $this->cadastrarDocumentoInterno(self::$documentoTeste); - - // Assinar documento interno criado anteriormente - $this->assinarDocumento(self::$remetente['ORGAO'], self::$remetente['CARGO_ASSINATURA'], self::$remetente['SENHA']); - - // Trâmitar Externamento processo para órgão/unidade destinatária - $this->tramitarProcessoExternamente( - self::$protocoloTeste, self::$destinatario['REP_ESTRUTURAS'], self::$destinatario['NOME_UNIDADE'], - self::$destinatario['SIGLA_UNIDADE_HIERARQUIA'], false); + + $this->realizarTramiteExternoSemvalidacaoNoRemetenteFixture(self::$processoTeste, self::$documentoTeste, self::$remetente, self::$destinatario); + self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } diff --git a/tests_super/funcional/tests/TramiteProcessoComHistoricoTest.php b/tests_super/funcional/tests/TramiteProcessoComHistoricoTest.php index 1a2f355b5..954410468 100755 --- a/tests_super/funcional/tests/TramiteProcessoComHistoricoTest.php +++ b/tests_super/funcional/tests/TramiteProcessoComHistoricoTest.php @@ -4,7 +4,7 @@ * Execution Groups * @group execute_parallel_group3 */ -class TramiteProcessoComHistoricoTest extends CenarioBaseTestCase +class TramiteProcessoComHistoricoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -32,7 +32,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); self::$protocoloTeste = self::$processoTeste["PROTOCOLO"]; } diff --git a/tests_super/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php b/tests_super/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php index 68fd400ab..3dc0c3e7d 100755 --- a/tests_super/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php +++ b/tests_super/funcional/tests/TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest.php @@ -9,7 +9,7 @@ * Execution Groups * @group execute_parallel_group1 */ -class TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest extends CenarioBaseTestCase +class TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -33,28 +33,29 @@ public function test_tramitar_processo_contendo_documento_cancelado() self::$destinatario = $this->definirContextoTeste(CONTEXTO_ORGAO_B); // Definição de dados de teste do processo principal - self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); - + self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); self::$documentoTeste1 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); + $objProtocoloPrincipalDTO = $this->cadastrarProcessoFixture(self::$processoTeste); + + $this->cadastrarDocumentoExternoFixture(self::$documentoTeste1, $objProtocoloPrincipalDTO->getDblIdProtocolo()); + self::$protocoloTeste = $objProtocoloPrincipalDTO->getStrProtocoloFormatado(); + // Acessar sistema do this->REMETENTE do processo $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - // Cadastrar novo processo de teste e incluir documentos relacionados - $this->paginaBase->navegarParaControleProcesso(); - self::$protocoloTeste = $this->cadastrarProcesso(self::$processoTeste); - $this->cadastrarDocumentoExterno(self::$documentoTeste1); + $this->abrirProcesso(self::$protocoloTeste); //Tramitar internamento para liberação da funcionalidade de cancelar - $this->tramitarProcessoInternamenteParaCancelamento(self::$remetente['SIGLA_UNIDADE'], self::$remetente['SIGLA_UNIDADE_SECUNDARIA'], self::$processoTeste); + $this->tramitarProcessoInternamenteParaCancelamento(self::$remetente['SIGLA_UNIDADE'], self::$remetente['SIGLA_UNIDADE_SECUNDARIA'], [ 'PROTOCOLO' => self::$protocoloTeste ]); $this->navegarParaCancelarDocumento(0); $this->paginaCancelarDocumento->cancelar("Motivo de teste"); $processo=self::$processoTeste; - + $bancoOrgaoA = new DatabaseUtils(CONTEXTO_ORGAO_A); - + $idAnexo = $bancoOrgaoA->query("SELECT an.id_anexo FROM rel_protocolo_protocolo pp inner join protocolo p on pp.id_protocolo_1=p.id_protocolo inner join anexo an on an.id_protocolo=pp.id_protocolo_2