Skip to content

Commit 4e9089a

Browse files
committed
Bump to PHPUnit 10
1 parent 20819de commit 4e9089a

File tree

10 files changed

+54
-53
lines changed

10 files changed

+54
-53
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"require-dev": {
2828
"ext-json": "*",
29-
"phpunit/phpunit": "^9.5"
29+
"phpunit/phpunit": "^10.5.45"
3030
},
3131
"prefer-stable": true,
3232
"autoload": {

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Esto incluye cambios al código relacionados con tipos, calidad de código y eli
1818

1919
Los siguientes cambios aplican al entorno de desarrollo.
2020

21+
- Se actualizan las pruebas a PHPUnit 10.
2122
- Se agrega la herramienta `composer-normalize` al proceso de construcción.
2223
- Se actualiza el estándar de código para `phpcs` y `php-cs-fixer`.
2324

phpunit.xml.dist

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4-
cacheResultFile="build/phpunit.result.cache"
5-
bootstrap="tests/bootstrap.php"
6-
colors="true"
7-
>
8-
<testsuites>
9-
<testsuite name="default">
10-
<directory>tests</directory>
11-
</testsuite>
12-
</testsuites>
13-
<coverage>
14-
<include>
15-
<directory suffix=".php">./src/</directory>
16-
</include>
17-
</coverage>
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
cacheResultFile="build/phpunit.result.cache"
5+
bootstrap="tests/bootstrap.php"
6+
colors="true"
7+
>
8+
<testsuites>
9+
<testsuite name="default">
10+
<directory>tests</directory>
11+
</testsuite>
12+
</testsuites>
13+
<source>
14+
<include>
15+
<directory suffix=".php">./src/</directory>
16+
</include>
17+
</source>
1818
</phpunit>

tests/Unit/DOMDocumentsTestCase.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,52 @@
99

1010
abstract class DOMDocumentsTestCase extends TestCase
1111
{
12-
public function documentCfdi40(): DOMDocument
12+
public static function documentCfdi40(): DOMDocument
1313
{
1414
$document = new DOMDocument();
15-
$document->load($this->filePath('cfdi40-real.xml'));
15+
$document->load(static::filePath('cfdi40-real.xml'));
1616
return $document;
1717
}
1818

19-
public function documentCfdi33(): DOMDocument
19+
public static function documentCfdi33(): DOMDocument
2020
{
2121
$document = new DOMDocument();
22-
$document->load($this->filePath('cfdi33-real.xml'));
22+
$document->load(static::filePath('cfdi33-real.xml'));
2323
return $document;
2424
}
2525

26-
public function documentCfdi32(): DOMDocument
26+
public static function documentCfdi32(): DOMDocument
2727
{
2828
$document = new DOMDocument();
29-
$document->load($this->filePath('cfdi32-real.xml'));
29+
$document->load(static::filePath('cfdi32-real.xml'));
3030
return $document;
3131
}
3232

33-
public function documentRet20Mexican(): DOMDocument
33+
public static function documentRet20Mexican(): DOMDocument
3434
{
3535
$document = new DOMDocument();
36-
$document->load($this->filePath('ret20-mexican-fake.xml'));
36+
$document->load(static::filePath('ret20-mexican-fake.xml'));
3737
return $document;
3838
}
3939

40-
public function documentRet20Foreign(): DOMDocument
40+
public static function documentRet20Foreign(): DOMDocument
4141
{
4242
$document = new DOMDocument();
43-
$document->load($this->filePath('ret20-foreign-fake.xml'));
43+
$document->load(static::filePath('ret20-foreign-fake.xml'));
4444
return $document;
4545
}
4646

47-
public function documentRet10Mexican(): DOMDocument
47+
public static function documentRet10Mexican(): DOMDocument
4848
{
4949
$document = new DOMDocument();
50-
$document->load($this->filePath('ret10-mexican-fake.xml'));
50+
$document->load(static::filePath('ret10-mexican-fake.xml'));
5151
return $document;
5252
}
5353

54-
public function documentRet10Foreign(): DOMDocument
54+
public static function documentRet10Foreign(): DOMDocument
5555
{
5656
$document = new DOMDocument();
57-
$document->load($this->filePath('ret10-foreign-fake.xml'));
57+
$document->load(static::filePath('ret10-foreign-fake.xml'));
5858
return $document;
5959
}
6060
}

tests/Unit/DiscoverExtractorTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ public function testThrowExceptionOnUnmatchedDocument(): void
5959
}
6060

6161
/** @return array<string, array{DOMDocument, string}> */
62-
public function providerExpressionOnValidDocuments(): array
62+
public static function providerExpressionOnValidDocuments(): array
6363
{
6464
return [
65-
'Cfdi40' => [$this->documentCfdi40(), 'CFDI40'],
66-
'Cfdi33' => [$this->documentCfdi33(), 'CFDI33'],
67-
'Cfdi32' => [$this->documentCfdi32(), 'CFDI32'],
68-
'Ret20Mexican' => [$this->documentRet20Mexican(), 'RET20'],
69-
'Ret20Foreign' => [$this->documentRet20Foreign(), 'RET20'],
70-
'Ret10Mexican' => [$this->documentRet10Mexican(), 'RET10'],
71-
'Ret10Foreign' => [$this->documentRet10Foreign(), 'RET10'],
65+
'Cfdi40' => [self::documentCfdi40(), 'CFDI40'],
66+
'Cfdi33' => [self::documentCfdi33(), 'CFDI33'],
67+
'Cfdi32' => [self::documentCfdi32(), 'CFDI32'],
68+
'Ret20Mexican' => [self::documentRet20Mexican(), 'RET20'],
69+
'Ret20Foreign' => [self::documentRet20Foreign(), 'RET20'],
70+
'Ret10Mexican' => [self::documentRet10Mexican(), 'RET10'],
71+
'Ret10Foreign' => [self::documentRet10Foreign(), 'RET10'],
7272
];
7373
}
7474

tests/Unit/Extractors/Comprobante32Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public function testExtractCfdi32(): void
3434
}
3535

3636
/** @return array<string, array{DOMDocument}> */
37-
public function providerCfdiDifferentVersions(): array
37+
public static function providerCfdiDifferentVersions(): array
3838
{
3939
return [
40-
'CFDI 4.0' => [$this->documentCfdi40()],
41-
'CFDI 3.3' => [$this->documentCfdi33()],
40+
'CFDI 4.0' => [self::documentCfdi40()],
41+
'CFDI 3.3' => [self::documentCfdi33()],
4242
];
4343
}
4444

tests/Unit/Extractors/Comprobante33Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public function testExtractCfdi33(): void
3434
}
3535

3636
/** @return array<string, array{DOMDocument}> */
37-
public function providerCfdiDifferentVersions(): array
37+
public static function providerCfdiDifferentVersions(): array
3838
{
3939
return [
40-
'CFDI 4.0' => [$this->documentCfdi40()],
41-
'CFDI 3.2' => [$this->documentCfdi32()],
40+
'CFDI 4.0' => [self::documentCfdi40()],
41+
'CFDI 3.2' => [self::documentCfdi32()],
4242
];
4343
}
4444

tests/Unit/Extractors/Comprobante40Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public function testExtractCfdi40(): void
3434
}
3535

3636
/** @return array<string, array{DOMDocument}> */
37-
public function providerCfdiDifferentVersions(): array
37+
public static function providerCfdiDifferentVersions(): array
3838
{
3939
return [
40-
'CFDI 3.3' => [$this->documentCfdi33()],
41-
'CFDI 3.2' => [$this->documentCfdi32()],
40+
'CFDI 3.3' => [self::documentCfdi33()],
41+
'CFDI 3.2' => [self::documentCfdi32()],
4242
];
4343
}
4444

tests/Unit/Extractors/Retenciones10Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ public function testExtractRetenciones10Mexican(): void
4444
}
4545

4646
/** @return array<string, array{DOMDocument}> */
47-
public function providerCfdiDifferentVersions(): array
47+
public static function providerCfdiDifferentVersions(): array
4848
{
4949
return [
50-
'RET 2.0 Mexican' => [$this->documentRet20Mexican()],
51-
'RET 2.0 Foreign' => [$this->documentRet20Foreign()],
50+
'RET 2.0 Mexican' => [self::documentRet20Mexican()],
51+
'RET 2.0 Foreign' => [self::documentRet20Foreign()],
5252
];
5353
}
5454

tests/Unit/Extractors/Retenciones20Test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ public function testExtractRetenciones20Mexican(): void
5252
}
5353

5454
/** @return array<string, array{DOMDocument}> */
55-
public function providerCfdiDifferentVersions(): array
55+
public static function providerCfdiDifferentVersions(): array
5656
{
5757
return [
58-
'RET 1.0 Mexican' => [$this->documentRet10Mexican()],
59-
'RET 1.0 Foreign' => [$this->documentRet10Foreign()],
58+
'RET 1.0 Mexican' => [self::documentRet10Mexican()],
59+
'RET 1.0 Foreign' => [self::documentRet10Foreign()],
6060
];
6161
}
6262

0 commit comments

Comments
 (0)