diff --git a/.github/workflows/analyzers.yaml b/.github/workflows/analyzers.yaml index 8670bcf..a1d3d57 100644 --- a/.github/workflows/analyzers.yaml +++ b/.github/workflows/analyzers.yaml @@ -7,7 +7,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['8.2', '8.3', '8.4'] + php-versions: ['8.3', '8.4', '8.5'] composer-options: ['--ignore-platform-req=php+'] fail-fast: false name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} @@ -24,3 +24,4 @@ jobs: run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} - name: Run the tests run: ./vendor/bin/psalm + continue-on-error: ${{ matrix.php-versions == '8.5' }} diff --git a/.github/workflows/code-style.yaml b/.github/workflows/code-style.yaml index a8a0975..867b2ee 100644 --- a/.github/workflows/code-style.yaml +++ b/.github/workflows/code-style.yaml @@ -7,7 +7,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['8.2', '8.3', '8.4'] + php-versions: ['8.3', '8.4', '8.5'] composer-options: ['--ignore-platform-req=php+'] fail-fast: false name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} @@ -23,4 +23,4 @@ jobs: - name: Install dependencies run: composer update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} - name: Run the tests - run: PHP_CS_FIXER_IGNORE_ENV=1 ./tools/php-cs-fixer.phar fix --dry-run + run: PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --dry-run diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b471eec..6229de6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -7,7 +7,7 @@ jobs: strategy: matrix: operating-system: [ubuntu-latest] - php-versions: ['8.2', '8.3', '8.4'] + php-versions: ['8.3', '8.4', '8.5'] composer-options: ['--ignore-platform-req=php+'] fail-fast: false name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} diff --git a/.phive/phars.xml b/.phive/phars.xml deleted file mode 100644 index 4aa93da..0000000 --- a/.phive/phars.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/composer.json b/composer.json index f50c594..0eaf8c8 100644 --- a/composer.json +++ b/composer.json @@ -26,18 +26,19 @@ "sort-packages": true }, "require": { - "php": "~8.2.0 || ~8.3.0 || ~8.4.0", + "php": "~8.3.0 || ~8.4.0 || ~8.5.0", "ext-dom": "*", - "azjezz/psl": "^3.0", + "azjezz/psl": "^3.0 || ^4.0", "league/uri": "^7.0", "league/uri-components": "^7.0", - "php-soap/xml": "^1.8", + "php-soap/xml": "^1.9", "symfony/console": "^5.4 || ^6.0 || ^7.0", "veewee/xml": "~3.0" }, "require-dev": { - "phpunit/phpunit": "^10.5", + "php-cs-fixer/shim": "^3.88", + "phpunit/phpunit": "^12.3", "psalm/plugin-symfony": "^5.0", - "vimeo/psalm": "^5.26.0" + "vimeo/psalm": "^6.13" } } diff --git a/phpunit.xml b/phpunit.xml index d9b5649..864b299 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,6 +2,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" displayDetailsOnPhpunitDeprecations="true" + displayDetailsOnTestsThatTriggerWarnings="true" + failOnWarning="true" + failOnPhpunitWarning="true" bootstrap="./tests/bootstrap.php" colors="true" > diff --git a/psalm.xml b/psalm.xml index 0dd8970..9dfceda 100644 --- a/psalm.xml +++ b/psalm.xml @@ -9,6 +9,8 @@ skipChecksOnUnresolvableIncludes="false" checkForThrowsDocblock="true" checkForThrowsInGlobalScope="true" + findUnusedCode="false" + ensureOverrideAttribute="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" diff --git a/tests/Unit/Loader/FlatteningLoaderTest.php b/tests/Unit/Loader/FlatteningLoaderTest.php index 205b689..ddcf093 100644 --- a/tests/Unit/Loader/FlatteningLoaderTest.php +++ b/tests/Unit/Loader/FlatteningLoaderTest.php @@ -3,6 +3,7 @@ namespace Soap\Wsdl\Test\Unit\Loader; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Soap\Wsdl\Loader\FlatteningLoader; use Soap\Wsdl\Loader\StreamWrapperLoader; @@ -18,10 +19,7 @@ protected function setUp(): void $this->loader = new FlatteningLoader(new StreamWrapperLoader()); } - /** - * - * @dataProvider provideTestCases - */ + #[DataProvider('provideTestCases')] public function test_it_can_load_flattened_imports(string $wsdl, Document $expected): void { $result = ($this->loader)($wsdl); diff --git a/tests/Unit/Uri/IncludePathBuilderTest.php b/tests/Unit/Uri/IncludePathBuilderTest.php index 4925251..d34abfc 100644 --- a/tests/Unit/Uri/IncludePathBuilderTest.php +++ b/tests/Unit/Uri/IncludePathBuilderTest.php @@ -4,15 +4,13 @@ namespace Soap\Wsdl\Test\Unit\Uri; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Soap\Wsdl\Uri\IncludePathBuilder; final class IncludePathBuilderTest extends TestCase { - /** - * - * @dataProvider provideBuildPaths - */ + #[DataProvider('provideBuildPaths')] public function test_it_can_build_include_paths(string $relativePath, string $fromFile, string $expected): void { static::assertSame($expected, IncludePathBuilder::build($relativePath, $fromFile)); diff --git a/tests/Unit/Xml/Configurator/FlattenTypesTest.php b/tests/Unit/Xml/Configurator/FlattenTypesTest.php index d05893f..fb86e5b 100644 --- a/tests/Unit/Xml/Configurator/FlattenTypesTest.php +++ b/tests/Unit/Xml/Configurator/FlattenTypesTest.php @@ -3,6 +3,7 @@ namespace Soap\Wsdl\Test\Unit\Xml\Configurator; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Soap\Wsdl\Xml\Configurator\FlattenTypes; use VeeWee\Xml\Dom\Document; @@ -10,10 +11,7 @@ final class FlattenTypesTest extends TestCase { - /** - * - * @dataProvider provideTestCases - */ + #[DataProvider('provideTestCases')] public function test_it_can_flatten_types(string $wsdl, Document $expected): void { $wsdlDoc = Document::fromXmlFile($wsdl, new FlattenTypes(), comparable()); diff --git a/tests/Unit/Xml/Configurator/FlattenWsdlImportsTest.php b/tests/Unit/Xml/Configurator/FlattenWsdlImportsTest.php index 7c3b8f2..1392a7a 100644 --- a/tests/Unit/Xml/Configurator/FlattenWsdlImportsTest.php +++ b/tests/Unit/Xml/Configurator/FlattenWsdlImportsTest.php @@ -3,6 +3,7 @@ namespace Soap\Wsdl\Test\Unit\Xml\Configurator; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Soap\Wsdl\Loader\Context\FlatteningContext; use Soap\Wsdl\Loader\StreamWrapperLoader; @@ -12,10 +13,7 @@ final class FlattenWsdlImportsTest extends TestCase { - /** - * - * @dataProvider provideTestCases - */ + #[DataProvider('provideTestCases')] public function test_it_can_flatten_wsdl_imports(string $wsdl, Document $expected): void { $wsdlDoc = Document::fromXmlFile($wsdl); diff --git a/tests/Unit/Xml/Configurator/FlattenXsdImportsTest.php b/tests/Unit/Xml/Configurator/FlattenXsdImportsTest.php index 91cb1a8..3688709 100644 --- a/tests/Unit/Xml/Configurator/FlattenXsdImportsTest.php +++ b/tests/Unit/Xml/Configurator/FlattenXsdImportsTest.php @@ -3,6 +3,7 @@ namespace Soap\Wsdl\Test\Unit\Xml\Configurator; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Soap\Wsdl\Loader\Context\FlatteningContext; use Soap\Wsdl\Loader\StreamWrapperLoader; @@ -13,10 +14,7 @@ final class FlattenXsdImportsTest extends TestCase { - /** - * - * @dataProvider provideTestCases - */ + #[DataProvider('provideTestCases')] public function test_it_can_flatten_xsd_imports(string $wsdl, Document $expected, callable $xmlConfigurator): void { $wsdlDoc = Document::fromXmlFile($wsdl); @@ -34,52 +32,52 @@ public static function provideTestCases() yield 'single-xsd' => [ 'wsdl' => FIXTURE_DIR.'/flattening/single-xsd.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/single-xsd-result.wsdl'), - comparable(), + "xmlConfigurator" => comparable(), ]; yield 'once-xsd' => [ 'wsdl' => FIXTURE_DIR.'/flattening/once-xsd.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/once-xsd-result.wsdl'), - comparable(), + "xmlConfigurator" => comparable(), ]; yield 'multi-xsd' => [ 'wsdl' => FIXTURE_DIR.'/flattening/multi-xsd.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/multi-xsd-result.wsdl'), - comparable(), + "xmlConfigurator" => comparable(), ]; yield 'circular-xsd' => [ 'wsdl' => FIXTURE_DIR.'/flattening/circular-xsd.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/circular-xsd-result.wsdl'), - comparable(), + "xmlConfigurator" => comparable(), ]; yield 'redefine-xsd' => [ 'wsdl' => FIXTURE_DIR.'/flattening/redefine-xsd.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/redefine-xsd-result.wsdl'), - comparable(), + "xmlConfigurator" => comparable(), ]; yield 'tnsless-xsd' => [ 'wsdl' => FIXTURE_DIR.'/flattening/tnsless-xsd.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/tnsless-xsd-result.wsdl'), - comparable(), + "xmlConfigurator" => comparable(), ]; yield 'grouped-xsd' => [ 'wsdl' => FIXTURE_DIR.'/flattening/grouped-xsd.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/grouped-xsd-result.wsdl'), - comparable(), + "xmlConfigurator" => comparable(), ]; yield 'root-xmlns-import-issue' => [ 'wsdl' => FIXTURE_DIR.'/flattening/root-xmlns-import-issue.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/root-xmlns-import-issue-result.wsdl'), - canonicalize(), + "xmlConfigurator" => canonicalize(), ]; yield 'rearranged-imports' => [ 'wsdl' => FIXTURE_DIR.'/flattening/rearranged-imports.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/rearranged-imports.wsdl'), - comparable(), + "xmlConfigurator" => comparable(), ]; yield 'import-xmlns-issue' => [ 'wsdl' => FIXTURE_DIR.'/flattening/conflicting-imports.wsdl', 'expected' => Document::fromXmlFile(FIXTURE_DIR.'/flattening/result/conflicting-imports.wsdl'), - canonicalize(), + "xmlConfigurator" => canonicalize(), ]; } } diff --git a/tests/Unit/Xml/Validator/SchemaSyntaxValidatorTest.php b/tests/Unit/Xml/Validator/SchemaSyntaxValidatorTest.php index 93fe8e9..186f904 100644 --- a/tests/Unit/Xml/Validator/SchemaSyntaxValidatorTest.php +++ b/tests/Unit/Xml/Validator/SchemaSyntaxValidatorTest.php @@ -3,16 +3,14 @@ namespace SoapTest\Wsdl\Xml\Validator; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Soap\Wsdl\Xml\Validator\SchemaSyntaxValidator; use VeeWee\Xml\Dom\Document; final class SchemaSyntaxValidatorTest extends TestCase { - /** - * - * @dataProvider provideTestCases - */ + #[DataProvider('provideTestCases')] public function test_it_can_validate_errors(string $wsdl, array $errorMessages): void { $validator = new SchemaSyntaxValidator(); diff --git a/tests/Unit/Xml/Validator/WsdlSyntaxValidatorTest.php b/tests/Unit/Xml/Validator/WsdlSyntaxValidatorTest.php index 2359501..a6c0748 100644 --- a/tests/Unit/Xml/Validator/WsdlSyntaxValidatorTest.php +++ b/tests/Unit/Xml/Validator/WsdlSyntaxValidatorTest.php @@ -3,16 +3,14 @@ namespace SoapTest\Wsdl\Xml\Validator; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Soap\Wsdl\Xml\Validator\WsdlSyntaxValidator; use VeeWee\Xml\Dom\Document; final class WsdlSyntaxValidatorTest extends TestCase { - /** - * - * @dataProvider provideTestCases - */ + #[DataProvider('provideTestCases')] public function test_it_can_validate_errors(string $wsdl, array $errorMessages): void { $validator = new WsdlSyntaxValidator(); diff --git a/tests/Unit/Xml/Visitor/ReprefixTypeQnameTest.php b/tests/Unit/Xml/Visitor/ReprefixTypeQnameTest.php index 0a41ee4..1d99191 100644 --- a/tests/Unit/Xml/Visitor/ReprefixTypeQnameTest.php +++ b/tests/Unit/Xml/Visitor/ReprefixTypeQnameTest.php @@ -2,16 +2,14 @@ namespace SoapTest\Wsdl\Unit\Xml\Visitor; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Soap\Wsdl\Xml\Visitor\ReprefixTypeQname; use VeeWee\Xml\Dom\Document; final class ReprefixTypeQnameTest extends TestCase { - /** - * - * @dataProvider provideCases - */ + #[DataProvider('provideCases')] public function test_it_can_reprefix_qname_types(string $input, string $expected): void { $doc = Document::fromXmlString($input); diff --git a/tests/Unit/Xml/Xmlns/RegisterNonConflictingXmlnsNamespacesTest.php b/tests/Unit/Xml/Xmlns/RegisterNonConflictingXmlnsNamespacesTest.php index 93a7a4a..ad53f22 100644 --- a/tests/Unit/Xml/Xmlns/RegisterNonConflictingXmlnsNamespacesTest.php +++ b/tests/Unit/Xml/Xmlns/RegisterNonConflictingXmlnsNamespacesTest.php @@ -2,16 +2,14 @@ namespace SoapTest\Wsdl\Unit\Xml\Xmlns; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Soap\Wsdl\Xml\Xmlns\RegisterNonConflictingXmlnsNamespaces; use VeeWee\Xml\Dom\Document; final class RegisterNonConflictingXmlnsNamespacesTest extends TestCase { - /** - * - * @dataProvider provideCases - */ + #[DataProvider('provideCases')] public function test_it_registers_non_conflicting_namespaces( string $existingSchemaXml, string $importedSchemaXml, diff --git a/tools/php-cs-fixer.phar b/tools/php-cs-fixer.phar deleted file mode 100755 index d071fa5..0000000 Binary files a/tools/php-cs-fixer.phar and /dev/null differ