Skip to content

Commit a66bc54

Browse files
committed
Merge branch 'master' of github.com:LibreDTE/libredte-sdk-php
2 parents 38ea13d + 220dace commit a66bc54

36 files changed

Lines changed: 4249 additions & 4165 deletions

.github/workflows/ci.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ on:
44
push:
55
branches:
66
- master # Ejecuta pruebas al hacer push en la rama 'master'
7+
env:
8+
env_var: ${{ vars.ENV_CONTEXT_VAR }}
79

810
jobs:
911
test:
1012
runs-on: ubuntu-latest
1113

1214
strategy:
1315
matrix:
14-
php-version: ['7.3', '8.0'] # Puedes cambiar las versiones según necesites
16+
php-version: ['8.3'] # Puedes cambiar las versiones según necesites
1517

1618
steps:
1719
- name: Check out repository code
@@ -22,24 +24,17 @@ jobs:
2224
with:
2325
php-version: ${{ matrix.php-version }} # Configura la versión de PHP desde la matriz
2426
extensions: curl, mbstring, intl, xdebug
25-
toos: composer
27+
tools: composer
2628

2729
- name: Install Composer dependencies
2830
run: composer install --no-progress --no-suggest
2931

30-
# No hay forma de reemplazar esto por la opción enviada en correo
31-
- name: Create temporary env file
32-
run: |
33-
echo "LIBREDTE_HASH=${{ secrets.LIBREDTE_HASH }}" >> tests/test.env
34-
echo "LIBREDTE_RUT=${{ vars.LIBREDTE_RUT }}" >> tests/test.env
35-
36-
- name: Run PHP tests read only
37-
run: |
38-
composer tests_readonly
39-
4032
- name: Run PHP tests dte temp
33+
env:
34+
LIBREDTE_HASH: ${{ secrets.LIBREDTE_HASH }}
35+
LIBREDTE_RUT: ${{ vars.LIBREDTE_RUT }}
4136
run: |
42-
composer tests_dte_temp
37+
composer tests-readonly
4338
4439
- name: Upload PHPUnit result report
4540
if: failure()
@@ -48,5 +43,11 @@ jobs:
4843
name: tests-testdox-php_${{ matrix.php-version }}.txt
4944
path: var/tests-testdox.txt
5045

46+
- name: Upload Coverage Report
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: tests-coverage-php_${{ matrix.php-version }}.txt
50+
path: var/tests-coverage.txt
51+
5152
- name: Display PHP version
5253
run: php -v

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
vendor/
22
tests/test.env
3+
tests/archivos/dte_facturacion/*
34

45
var/
56
tools/

.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: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,36 @@
1717
},
1818
"config": {
1919
"platform": {
20-
"php": "7.3"
20+
"php": "8.2"
2121
}
2222
},
2323
"require": {
24-
"php": "^7.3 || ^8.0",
24+
"php": "^8.2 || ^8.3",
2525
"ext-curl": "*"
2626
},
2727
"require-dev": {
28-
"phpdocumentor/phpdocumentor": "^2.9",
29-
"phpunit/phpunit": "^9.2",
28+
"friendsofphp/php-cs-fixer": "^3.63",
29+
"phpstan/phpstan": "^1.12",
30+
"phpunit/phpunit": "^11.3",
3031
"vlucas/phpdotenv": "^5.6"
3132
},
3233
"autoload": {
33-
"psr-4": {"libredte\\api_client\\": "src/"}
34+
"psr-4": {
35+
"libredte\\api_client\\": "src/",
36+
"libredte\\dte_facturacion\\": "tests/dte_facturacion/",
37+
"libredte\\pagos_cobros_masivos\\": "tests/pagos_cobros_masivos/"
38+
}
3439
},
3540
"scripts": {
3641
"docs": "php tools/phpdocumentor run --config=phpdoc.xml",
3742
"tests": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=phpunit.xml",
38-
"tests_dte": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite dte",
39-
"tests_contab": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite contab",
40-
"tests_pagos": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite pagos",
41-
"tests_readonly": "vendor/bin/phpunit --testsuite readonly --filter 'test_dte_buscar_documento_emitido|test_dte_estado|test_dte_consultar|test_dte_ted|test_pagos_buscar_cobro|test_pagos_info_cobro'",
42-
"tests_dte_temp": "vendor/bin/phpunit --configuration=phpunit.xml --no-coverage --testsuite dte_temp"
43+
"tests-dte": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=phpunit.xml --testsuite dte-facturacion",
44+
"tests-contab": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=phpunit.xml --testsuite lce-contabilidad",
45+
"tests-cobros": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=phpunit.xml --testsuite pagos-cobros-mas",
46+
"tests-readonly": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=phpunit.xml --filter 'testBuscarDteTemp|testDescargarPdfDteTemp|testEmitirDteTemp|testEliminarDteTemp|testListarDteTemp|testListarCobrosDteTemp|testBuscarCobroDteTemp'",
47+
"phpcs-fix": "php-cs-fixer fix -v --config=php-cs-fixer.php .",
48+
"phpcs-fix-dry-run": "php-cs-fixer fix -v --dry-run --diff --config=php-cs-fixer.php .",
49+
"phpstan": "phpstan analyse --configuration=phpstan.neon --memory-limit=1G",
50+
"phpstan-export": "phpstan analyse --configuration=phpstan.neon --level 9 --generate-baseline"
4351
}
4452
}

0 commit comments

Comments
 (0)