Skip to content

Commit

Permalink
feat: alteração de fixtures para o sei
Browse files Browse the repository at this point in the history
  • Loading branch information
Mauro Costa committed Feb 9, 2024
1 parent 0399f51 commit e247d3f
Show file tree
Hide file tree
Showing 36 changed files with 103 additions and 1,444 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ update: ## Atualiza banco de dados através dos scripts de atualização do sist


destroy: .env
@$(CMD_COMPOSE_FUNC) exec org1-http bash -c "rm -rf /var/sei/arquivos/*"
@$(CMD_COMPOSE_FUNC) exec org2-http bash -c "rm -rf /var/sei/arquivos/*"
$(CMD_COMPOSE_FUNC) down --volumes


down: .env
$(CMD_COMPOSE_FUNC) stop

Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"php": "7.3.12"
}
},
"autoload-dev": {
"psr-4": {
"TestDTO\\": "src"
}
},
"require-dev": {
"php": "7.3.12",
"phpunit/phpunit": "*",
Expand Down
10 changes: 0 additions & 10 deletions tests_sei3/funcional/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

require_once __DIR__ . '/vendor/autoload.php';

require_once __DIR__ . '/sei/src/sei/web/SEI.php';

define("DIR_SEI_WEB", __DIR__ . '/sei/src/sei/web/');
define("DIR_TEST", __DIR__ );
define("DIR_PROJECT", __DIR__ . '/..' );
define("DIR_INFRA", __DIR__ . '/../src/infra/infra_php' );

error_reporting(E_ERROR);
restore_error_handler();

//Classes utilitárias para manipulação dos dados do SEI
require_once __DIR__ . '/src/utils/DatabaseUtils.php';
require_once __DIR__ . '/src/utils/ParameterUtils.php';
Expand Down
9 changes: 1 addition & 8 deletions tests_sei3/funcional/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@

"autoload": {
"classmap": [
"src/",
"sei/modpen/"
"src/"
]
},

"autoload-dev": {
"psr-4": {
"Tests\\": "sei/"
}
},

"require-dev": {
"phpunit/phpunit": "8.*",
Expand Down
2 changes: 1 addition & 1 deletion tests_sei4/funcional/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

require_once __DIR__ . '/sei/src/sei/web/SEI.php';

define("DIR_SEI_WEB", __DIR__ . '/sei/src/sei/web/');
define("DIR_SEI_WEB", __DIR__ . '/sei/src/sei/web/' );
define("DIR_TEST", __DIR__ );
define("DIR_PROJECT", __DIR__ . '/..' );
define("DIR_INFRA", __DIR__ . '/../src/infra/infra_php' );
Expand Down
6 changes: 5 additions & 1 deletion tests_sei4/funcional/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ services:
- ${SEI_PATH}/../tests:/tests/sei
- ${SEI_PATH}/../src:/tests/sei/src
- ./src/fixtures:/tests/sei/modpen/fixtures
- ../../src/bd:/tests/sei/modpen/bd
- ../../src/dto:/tests/sei/modpen/dto
- ../../src/bd:/tests/sei/modpen/bd
- ./assets/config:/opt/sei/config/mod-pen
- /tmp:/tmp
- /tmp/sei_arquivos_1:/var/sei/arquivos/${ORG1_DATABASE_HOST}
- /tmp/sei_arquivos_2:/var/sei/arquivos/${ORG2_DATABASE_HOST}
environment:
- XDEBUG_CONFIG=client_host=host.docker.internal client_port=9003 start_with_request=0
- XDEBUG_SESSION=default
Expand All @@ -71,6 +73,7 @@ services:
- ORG1_CERTIFICADO_SENHA=${ORG1_CERTIFICADO_SENHA}
- ORG2_CERTIFICADO=${ORG2_CERTIFICADO}
- ORG2_CERTIFICADO_SENHA=${ORG2_CERTIFICADO_SENHA}
- DATABASE_IMAGE=${ORG1_DATABASE_IMAGE}
- DATABASE_TYPE=${ORG1_DATABASE_TYPE}
- DATABASE_HOST=${ORG1_DATABASE_HOST}
- DATABASE_PORT=${ORG1_DATABASE_GUEST_PORT}
Expand All @@ -80,6 +83,7 @@ services:
- SIP_DATABASE_NAME=${SIP_DATABASE_NAME}
- SIP_DATABASE_USER=${SIP_DATABASE_USER}
- SIP_DATABASE_PASSWORD=${SIP_DATABASE_PASSWORD}
- TEST_FILES_PATH=${TEST_FILES_PATH}
extra_hosts:
- "host.docker.internal:host-gateway"
links:
Expand Down
51 changes: 0 additions & 51 deletions tests_sei4/funcional/src/fixtures/AssinaturaFixture.php

This file was deleted.

41 changes: 0 additions & 41 deletions tests_sei4/funcional/src/fixtures/AtividadeFixture.php

This file was deleted.

31 changes: 0 additions & 31 deletions tests_sei4/funcional/src/fixtures/AtributoAndamentoFixture.php

This file was deleted.

32 changes: 0 additions & 32 deletions tests_sei4/funcional/src/fixtures/DocumentoConteudoFixture.php

This file was deleted.

97 changes: 0 additions & 97 deletions tests_sei4/funcional/src/fixtures/DocumentoFixture.php

This file was deleted.

25 changes: 22 additions & 3 deletions tests_sei4/funcional/src/fixtures/FixtureBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,39 @@ public function carregar($dados = null, $callback = null){
}

public function carregarVarios($dados = null, $quantidade = 1){
$resultado = array();
$resultado = [];
for ($i=0; $i < $quantidade; $i++) {
$resultado[] = $this->carregar($dados);
}

return $resultado;
}

public function carregarVariados($dados){
$resultado = [];
foreach ($dados as $dado) {
$resultado[] = $this->carregar($dado);
}
}

return $resultado;
}

protected function listarInternoControlado($parametros){
$dto = $this->listar($parametros["dados"]);

if (isset($parametros["callback"])) {
$parametros["callback"]($dto);
}

return $dto;
}

public function buscar($dados = null, $callback = null){
$dados = $dados ?: [];
return $this->listarInterno([
'dados' => $dados,
'callback' => $callback
]);
}

}
Loading

0 comments on commit e247d3f

Please sign in to comment.