Skip to content

Commit eabbc28

Browse files
committed
Se añadieron servicios al API Client para gestión de BHEs, receptores y servicios provistos. Se reestructuró la carpeta tests/. Se añadieron más testss de acuerdo a los servicios nuevos, y se modificaron tests ya existentes. Se adaptó la documentación a la modificación de API Client y tests. Se estandarizó el código y los tests. Se modificó test.env-dist, y se alteraron algunas variables de entorno necesarias. Se modificó la versión de PHP necesaria para funcionar: Ahora es PHP 8.3.
1 parent 976ae13 commit eabbc28

35 files changed

+2213
-540
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,25 @@ jobs:
2727
- name: Install Composer dependencies
2828
run: composer install --no-progress --no-suggest
2929

30-
- name: Create temporary env file
31-
run: |
32-
echo "BHEXPRESS_API_TOKEN=${{ secrets.BHEXPRESS_API_TOKEN }}" >> tests/test.env
33-
echo "BHEXPRESS_EMISOR_RUT=${{ secrets.BHEXPRESS_EMISOR_RUT }}" >> tests/test.env
34-
3530
- name: Run PHP tests read only
31+
env:
32+
BHEXPRESS_API_TOKEN: ${{ secrets.BHEXPRESS_API_TOKEN }}
33+
BHEXPRESS_EMISOR_RUT: ${{ vars.BHEXPRESS_EMISOR_RUT }}
3634
run: |
37-
composer tests_readonly
35+
composer tests-readonly
3836
39-
- name: Upload PHPUnit result report
37+
- name: Upload pytest result report
4038
if: failure()
4139
uses: actions/upload-artifact@v4
4240
with:
43-
name: tests-testdox-php_${{ matrix.php-version }}.txt
44-
path: var/tests-testdox.txt
41+
name: tests-results-python_${{ matrix.python-version }}.xml
42+
path: var/tests-results.xml
43+
44+
- name: Upload Coverage Report
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: tests-coverage-python_${{ matrix.python-version }}.xml
48+
path: var/tests-coverage.xml
4549

4650
- name: Display PHP version
4751
run: php -v

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ Dockerfile
66
var/
77
tools/
88
build/
9+
tests/archivos/bhe_emitidas_pdf/*
910

10-
prueba-ejemplo.php
11+
prueba-ejemplo.php
12+
phpstan-baseline.neon

.scrutinizer.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
checks:
2+
php: true
3+
4+
build:
5+
nodes:
6+
analysis:
7+
tests:
8+
override:
9+
- php-scrutinizer-run
10+
- command: composer tests-readonly
11+
coverage:
12+
file: var/tests-coverage.xml
13+
format: clover
14+
environment:
15+
php:
16+
version: 8.3.13
17+
pecl_extensions:
18+
- xdebug
19+
dependencies:
20+
before:
21+
- composer install --no-progress --prefer-dist
22+
23+
tools:
24+
php_code_sniffer:
25+
enabled: true
26+
config:
27+
standard: PSR12
28+
29+
filter:
30+
paths:
31+
- src/*
32+
excluded_paths:
33+
- resources/*
34+
- tests/*
35+
- tools/*
36+
- var/*
37+
- vendor/*

composer.json

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,32 @@
1616
"source": "https://github.com/BHExpress/bhexpress-api-client-php"
1717
},
1818
"require": {
19-
"php": "^8.2",
20-
"guzzlehttp/guzzle": "^7"
19+
"guzzlehttp/guzzle": "^7",
20+
"php": "^8.2 || ^8.3"
2121
},
2222
"require-dev": {
23-
"ext-xdebug": "*",
2423
"friendsofphp/php-cs-fixer": "^3.63",
2524
"phpstan/phpstan": "^1.12",
26-
"phpunit/phpunit": "^11.4"
25+
"phpunit/phpunit": "^11.3",
26+
"vlucas/phpdotenv": "^5.6"
2727
},
2828
"autoload": {
29-
"psr-4": {"bhexpress\\api_client\\": "src/"}
29+
"psr-4": {
30+
"bhexpress\\api_client\\": "src/",
31+
"bhexpress\\api_client\\bhe\\": "src/bhe/",
32+
"bhexpress\\tests\\bhe\\": "tests/bhe/boletas/"
33+
}
3034
},
3135
"scripts": {
3236
"docs": "php tools/phpdocumentor run --config=phpdoc.xml",
3337
"tests": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=phpunit.xml",
34-
"tests_readonly": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite readonly",
35-
"tests_authneeded": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite authneeded"
38+
"tests-boletas": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite boletas",
39+
"tests-servicios": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite servicios",
40+
"tests-receptores": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite receptores",
41+
"tests-readonly": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=phpunit.xml --filter 'testCalcularMontoBruto|testCalcularMontoLiquido|testListarBhes|testListarReceptores|testListarServicios'",
42+
"phpcs-fix": "php-cs-fixer fix -v --config=php-cs-fixer.php .",
43+
"phpcs-fix-dry-run": "php-cs-fixer fix -v --dry-run --diff --config=php-cs-fixer.php .",
44+
"phpstan": "phpstan analyse --configuration=phpstan.neon --memory-limit=1G",
45+
"phpstan-export": "phpstan analyse --configuration=phpstan.neon --level 9 --generate-baseline"
3646
}
3747
}

0 commit comments

Comments
 (0)