diff --git a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php index 81082f33f..8e9983687 100755 --- a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php +++ b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php @@ -1,7 +1,5 @@ gerarDadosDocumentoExternoTeste(self::$remetente); // Busca ID que Protocolo principal recebeu no org2 - $parametros = [ - 'ProtocoloFormatado' => self::$protocoloTesteAnexado, - ]; - $objProtocoloFixture = new ProtocoloFixture(); - $objProtocoloAnexadoDTO = $objProtocoloFixture->buscar($parametros)[0]; + $objProtocoloAnexadoDTO = $this->consultarProcessoFixture(self::$protocoloTesteAnexado, \ProtocoloRN::$TP_PROCEDIMENTO); $this->cadastrarDocumentoExternoFixture(self::$documentoTeste3, $objProtocoloAnexadoDTO->getDblIdProtocolo()); // Gerar dados de testes para representar o processo principal diff --git a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoContendoOutroAnexadoTest.php b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoContendoOutroAnexadoTest.php index a9de4d870..d92632bed 100755 --- a/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoContendoOutroAnexadoTest.php +++ b/tests_sei4/funcional/tests/TramiteProcessoComDevolucaoContendoOutroAnexadoTest.php @@ -1,7 +1,5 @@ cadastrarDocumentoExternoFixture(self::$documentoTeste5, $objProtocoloAnexadoDTO->getDblIdProtocolo()); // Incluir novos documentos relacionados no processo anexado - $parametros = [ - 'ProtocoloFormatado' => self::$protocoloTestePrincipal, - ]; - $objProtocoloFixture = new ProtocoloFixture(); - $objProtocoloPrincipalDTO = $objProtocoloFixture->buscar($parametros)[0]; + $objProtocoloPrincipalDTO = $this->consultarProcessoFixture(self::$protocoloTestePrincipal, \ProtocoloRN::$TP_PROCEDIMENTO); $this->anexarProcessoFixture($objProtocoloPrincipalDTO->getDblIdProtocolo(), $objProtocoloAnexadoDTO->getDblIdProtocolo()); diff --git a/tests_sei4/funcional/tests/TramiteRecebimentoDocumentoAvulsoTest.php b/tests_sei4/funcional/tests/TramiteRecebimentoDocumentoAvulsoTest.php index 30d108705..f0a9c1ac3 100755 --- a/tests_sei4/funcional/tests/TramiteRecebimentoDocumentoAvulsoTest.php +++ b/tests_sei4/funcional/tests/TramiteRecebimentoDocumentoAvulsoTest.php @@ -27,7 +27,7 @@ class TramiteRecebimentoDocumentoAvulsoTest extends FixtureCenarioBaseTestCase /** * Teste preparatório (setUp()). Definição de contextos e instanciação da api de integração - * + * * @Depends CenarioBaseTestCase::setUpBeforeClass * * @return void @@ -39,6 +39,7 @@ public function setUp(): void // Carregar contexto de testes e dados sobre certificado digital self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_B); self::$destinatario = $this->definirContextoTeste(CONTEXTO_ORGAO_A); + putenv("DATABASE_HOST=org2-database"); // Instanciar objeto de teste utilizando o BeSimpleSoap $localCertificado = self::$remetente['LOCALIZACAO_CERTIFICADO_DIGITAL']; @@ -87,6 +88,7 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste3 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste2, self::$documentoTeste3); + putenv("DATABASE_HOST=org1-database"); $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } @@ -125,8 +127,8 @@ public function test_devolucao_processo_para_origem_documento_avulso() self::$documentoTeste4 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); self::$documentoTeste5 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); - $documentos = array(self::$documentoTeste4, self::$documentoTeste5); putenv("DATABASE_HOST=org2-database"); + $documentos = array(self::$documentoTeste4, self::$documentoTeste5); $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } diff --git a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php index 4774100f4..8e9983687 100755 --- a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php +++ b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php @@ -10,7 +10,7 @@ * Execution Groups * @group execute_alone_group5 */ -class TramiteProcessoComDevolucaoAnexadoOutroTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoAnexadoOutroTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -48,7 +48,8 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTesteAnexado, $documentos, self::$remetente, self::$destinatario); + + $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTesteAnexado, $documentos, self::$remetente, self::$destinatario); self::$protocoloTesteAnexado = self::$processoTesteAnexado["PROTOCOLO"]; } @@ -84,15 +85,14 @@ public function test_devolucao_processo_anexado_em_outro_para_origem() { self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_B); self::$destinatario = $this->definirContextoTeste(CONTEXTO_ORGAO_A); + // Selecionar banco do org2 para fazer inserção dos documentos + putenv("DATABASE_HOST=org2-database"); self::$documentoTeste3 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); - // Acessar sistema do this->REMETENTE do processo - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); - - // Incluir novos documentos relacionados no processo anexado - $this->abrirProcesso(self::$protocoloTesteAnexado); - $this->cadastrarDocumentoExterno(self::$documentoTeste3); + // Busca ID que Protocolo principal recebeu no org2 + $objProtocoloAnexadoDTO = $this->consultarProcessoFixture(self::$protocoloTesteAnexado, \ProtocoloRN::$TP_PROCEDIMENTO); + $this->cadastrarDocumentoExternoFixture(self::$documentoTeste3, $objProtocoloAnexadoDTO->getDblIdProtocolo()); // Gerar dados de testes para representar o processo principal self::$processoTestePrincipal = $this->gerarDadosProcessoTeste(self::$remetente); @@ -100,14 +100,23 @@ public function test_devolucao_processo_anexado_em_outro_para_origem() self::$documentoTeste5 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); // Cadastra processo principal, seus documentos e anexa processo recebido anteriormente - self::$protocoloTestePrincipal = $this->cadastrarProcesso(self::$processoTestePrincipal); - $this->cadastrarDocumentoInterno(self::$documentoTeste4); - $this->assinarDocumento(self::$remetente['ORGAO'], self::$remetente['CARGO_ASSINATURA'], self::$remetente['SENHA']); + $objProtocoloPrincipalDTO = $this->cadastrarProcessoFixture(self::$processoTestePrincipal); + self::$protocoloTestePrincipal = $objProtocoloPrincipalDTO->getStrProtocoloFormatado(); + + // Cadastra e assina + $this->cadastrarDocumentoInternoFixture(self::$documentoTeste4,$objProtocoloPrincipalDTO->getDblIdProtocolo()); - $this->anexarProcesso(self::$protocoloTesteAnexado); + $this->anexarProcessoFixture($objProtocoloPrincipalDTO->getDblIdProtocolo(), $objProtocoloAnexadoDTO->getDblIdProtocolo()); - $this->cadastrarDocumentoExterno(self::$documentoTeste5); + $this->cadastrarDocumentoExternoFixture(self::$documentoTeste5, $objProtocoloPrincipalDTO->getDblIdProtocolo()); + + putenv("DATABASE_HOST=org1-database"); + // Acessar sistema do this->REMETENTE do processo + $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); + + // Abre processo principal para tramitar + $this->abrirProcesso(self::$protocoloTestePrincipal); // Trâmitar Externamento processo para órgão/unidade destinatária $this->tramitarProcessoExternamente( diff --git a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoContendoOutroAnexadoTest.php b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoContendoOutroAnexadoTest.php index bcdf62d9c..d92632bed 100755 --- a/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoContendoOutroAnexadoTest.php +++ b/tests_sei41/funcional/tests/TramiteProcessoComDevolucaoContendoOutroAnexadoTest.php @@ -9,7 +9,7 @@ * Execution Groups * @group execute_alone_group5 */ -class TramiteProcessoComDevolucaoContendoOutroAnexadoTest extends CenarioBaseTestCase +class TramiteProcessoComDevolucaoContendoOutroAnexadoTest extends FixtureCenarioBaseTestCase { public static $remetente; public static $destinatario; @@ -45,7 +45,7 @@ public function test_tramitar_processo_da_origem() self::$documentoTeste2 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste1, self::$documentoTeste2); - $this->realizarTramiteExternoComValidacaoNoRemetente(self::$processoTestePrincipal, $documentos, self::$remetente, self::$destinatario); + $this->realizarTramiteExternoComvalidacaoNoRemetenteFixture(self::$processoTestePrincipal, $documentos, self::$remetente, self::$destinatario); self::$protocoloTestePrincipal = self::$processoTestePrincipal["PROTOCOLO"]; } @@ -81,9 +81,7 @@ public function test_devolucao_processo_contendo_outro_anexado_para_origem() { self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_B); self::$destinatario = $this->definirContextoTeste(CONTEXTO_ORGAO_A); - - // Acessar sistema do this->REMETENTE do processo - $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); + putenv("DATABASE_HOST=org2-database"); // Gerar dados de testes para representar o processo principal self::$processoTesteAnexado = $this->gerarDadosProcessoTeste(self::$remetente); @@ -91,18 +89,23 @@ public function test_devolucao_processo_contendo_outro_anexado_para_origem() self::$documentoTeste5 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); // Cadastra processo anexado, seus documentos e anexar ao processo principal recebido anteriormente - self::$protocoloTesteAnexado = $this->cadastrarProcesso(self::$processoTesteAnexado); - $this->cadastrarDocumentoInterno(self::$documentoTeste4); - $this->assinarDocumento(self::$remetente['ORGAO'], self::$remetente['CARGO_ASSINATURA'], self::$remetente['SENHA']); - $this->cadastrarDocumentoExterno(self::$documentoTeste5); + $objProtocoloAnexadoDTO = $this->cadastrarProcessoFixture(self::$processoTesteAnexado); + self::$protocoloTesteAnexado = $objProtocoloAnexadoDTO->getStrProtocoloFormatado(); + $this->cadastrarDocumentoInternoFixture(self::$documentoTeste4, $objProtocoloAnexadoDTO->getDblIdProtocolo()); + $this->cadastrarDocumentoExternoFixture(self::$documentoTeste5, $objProtocoloAnexadoDTO->getDblIdProtocolo()); // Incluir novos documentos relacionados no processo anexado - $this->abrirProcesso(self::$protocoloTestePrincipal); - $this->anexarProcesso(self::$protocoloTesteAnexado); + $objProtocoloPrincipalDTO = $this->consultarProcessoFixture(self::$protocoloTestePrincipal, \ProtocoloRN::$TP_PROCEDIMENTO); + + $this->anexarProcessoFixture($objProtocoloPrincipalDTO->getDblIdProtocolo(), $objProtocoloAnexadoDTO->getDblIdProtocolo()); + self::$documentoTeste3 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); - $this->cadastrarDocumentoExterno(self::$documentoTeste3); + $this->cadastrarDocumentoExternoFixture(self::$documentoTeste3, $objProtocoloPrincipalDTO->getDblIdProtocolo()); + + $this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); + + $this->abrirProcesso(self::$protocoloTestePrincipal); - // Trâmitar Externamento processo para órgão/unidade destinatária $this->tramitarProcessoExternamente( self::$protocoloTestePrincipal, self::$destinatario['REP_ESTRUTURAS'], diff --git a/tests_sei41/funcional/tests/TramiteRecebimentoDocumentoAvulsoTest.php b/tests_sei41/funcional/tests/TramiteRecebimentoDocumentoAvulsoTest.php index 30d108705..f0a9c1ac3 100755 --- a/tests_sei41/funcional/tests/TramiteRecebimentoDocumentoAvulsoTest.php +++ b/tests_sei41/funcional/tests/TramiteRecebimentoDocumentoAvulsoTest.php @@ -27,7 +27,7 @@ class TramiteRecebimentoDocumentoAvulsoTest extends FixtureCenarioBaseTestCase /** * Teste preparatório (setUp()). Definição de contextos e instanciação da api de integração - * + * * @Depends CenarioBaseTestCase::setUpBeforeClass * * @return void @@ -39,6 +39,7 @@ public function setUp(): void // Carregar contexto de testes e dados sobre certificado digital self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_B); self::$destinatario = $this->definirContextoTeste(CONTEXTO_ORGAO_A); + putenv("DATABASE_HOST=org2-database"); // Instanciar objeto de teste utilizando o BeSimpleSoap $localCertificado = self::$remetente['LOCALIZACAO_CERTIFICADO_DIGITAL']; @@ -87,6 +88,7 @@ public function test_devolucao_processo_para_origem() self::$documentoTeste3 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); $documentos = array(self::$documentoTeste2, self::$documentoTeste3); + putenv("DATABASE_HOST=org1-database"); $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } @@ -125,8 +127,8 @@ public function test_devolucao_processo_para_origem_documento_avulso() self::$documentoTeste4 = $this->gerarDadosDocumentoInternoTeste(self::$remetente); self::$documentoTeste5 = $this->gerarDadosDocumentoExternoTeste(self::$remetente); - $documentos = array(self::$documentoTeste4, self::$documentoTeste5); putenv("DATABASE_HOST=org2-database"); + $documentos = array(self::$documentoTeste4, self::$documentoTeste5); $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); } diff --git a/tests_super/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php b/tests_super/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php index 8271e00ce..8e9983687 100755 --- a/tests_super/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php +++ b/tests_super/funcional/tests/TramiteProcessoComDevolucaoAnexadoOutroTest.php @@ -1,7 +1,5 @@ gerarDadosDocumentoExternoTeste(self::$remetente); putenv("DATABASE_HOST=org2-database"); + $documentos = array(self::$documentoTeste4, self::$documentoTeste5); $this->realizarTramiteExternoComValidacaoNoRemetenteFixture(self::$processoTeste, $documentos, self::$remetente, self::$destinatario); }