File tree Expand file tree Collapse file tree
tests/Features/XmlStringCleaners Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22<phive xmlns =" https://phar.io/phive" >
33 <phar name =" phpcs" version =" ^3.7.1" installed =" 3.7.1" location =" ./tools/phpcs" copy =" false" />
44 <phar name =" phpcbf" version =" ^3.7.1" installed =" 3.7.1" location =" ./tools/phpcbf" copy =" false" />
5- <phar name =" php-cs-fixer" version =" ^3.13.1 " installed =" 3.13.1 " location =" ./tools/php-cs-fixer" copy =" false" />
6- <phar name =" phpstan" version =" ^1.9.4 " installed =" 1.9.4 " location =" ./tools/phpstan" copy =" false" />
5+ <phar name =" php-cs-fixer" version =" ^3.14.3 " installed =" 3.14.3 " location =" ./tools/php-cs-fixer" copy =" false" />
6+ <phar name =" phpstan" version =" ^1.9.14 " installed =" 1.9.14 " location =" ./tools/phpstan" copy =" false" />
77</phive >
Original file line number Diff line number Diff line change 11The MIT License (MIT)
22
3- Copyright (c) 2021 - 2022 PhpCfdi https://www.phpcfdi.com/
3+ Copyright (c) 2021 - 2023 PhpCfdi https://www.phpcfdi.com/
44
55Permission is hereby granted, free of charge, to any person obtaining a copy
66of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change 44
55Utilizamos [ Versionado Semántico 2.0.0] ( SEMVER.md ) .
66
7- ## Cambios en la rama principal sin liberación de nueva versión.
7+ ## Cambios en la rama principal sin liberación de nueva versión
88
99Los cambios no liberados se integran a la rama principal, pero no requieren de la liberación de una nueva versión.
1010
11+ ### Mantenimiento 2023-02-07
12+
13+ - Se refactoriza una prueba porque en PHPUnit 9.6.3 se deprecó el método ` expectDeprecation() ` .
14+ - Se actualiza el año de la licencia. Feliz 2023.
15+ - Se actualizan las herramientas de desarrollo.
16+
1117## Versión 1.3.0
1218
1319Se agrega la opción de excluir limpiadores específicos por nombre de clase.
@@ -103,7 +109,7 @@ Para corregir este problema:
103109- Se elimina de la lista de limpiadores de texto por defecto a ` RemoveDuplicatedCfdi3Namespace ` .
104110- Se quita la funcionalidad de ` RemoveDuplicatedCfdi3Namespace ` y se emite un ` E_USER_DEPRECATED ` .
105111- Se crea un nuevo limpiador ` RenameElementAddPrefix ` que agrega el prefijo al nodo que no lo tiene por estar
106- utilizando la definición simple ` xmlns ` . Además elimina los namespace superfluos y las
112+ utilizando la definición simple ` xmlns ` . Además, elimina los namespace superfluos y las
107113 definiciones ` xmlns ` redundantes.
108114
109115Ejemplo de CFDI sucio:
Original file line number Diff line number Diff line change 55namespace PhpCfdi \CfdiCleaner \Tests \Features \XmlStringCleaners ;
66
77use PhpCfdi \CfdiCleaner \Tests \TestCase ;
8+ use PhpCfdi \CfdiCleaner \XmlDocumentCleaners \RenameElementAddPrefix ;
89use PhpCfdi \CfdiCleaner \XmlStringCleaners \RemoveDuplicatedCfdi3Namespace ;
910
1011class RemoveDuplicatedCfdi3NamespaceTest extends TestCase
@@ -38,8 +39,18 @@ public function providerInputCases(): array
3839 public function testClean (string $ expected , string $ input ): void
3940 {
4041 $ cleaner = new RemoveDuplicatedCfdi3Namespace ();
41- $ this ->expectDeprecation ();
42- $ clean = $ cleaner ->clean ($ input );
42+
43+ $ clean = @$ cleaner ->clean ($ input );
44+ $ error = error_get_last () ?? [];
45+
46+ $ expectedErrorMessage = sprintf (
47+ 'Class %s is deprecated, use %s ' ,
48+ RemoveDuplicatedCfdi3Namespace::class,
49+ RenameElementAddPrefix::class
50+ );
51+
52+ $ this ->assertSame (E_USER_DEPRECATED , intval ($ error ['type ' ] ?? 0 ));
53+ $ this ->assertSame ($ expectedErrorMessage , strval ($ error ['message ' ] ?? '' ));
4354
4455 $ this ->assertEquals ($ input , $ clean );
4556 }
You can’t perform that action at this time.
0 commit comments