From e1376a5c79b42db190c2294328e7a6148ebfd83f Mon Sep 17 00:00:00 2001 From: Michael Moll Date: Mon, 19 Jan 2026 15:33:57 +0100 Subject: [PATCH] Update PHPUnit to 10/11 --- .github/workflows/ci.yml | 8 ++++---- .gitignore | 1 + ...SniffUnitTest.php => AbstractMo4SniffUnitTestCase.php} | 2 +- MO4/Tests/Arrays/ArrayDoubleArrowAlignmentUnitTest.php | 4 ++-- MO4/Tests/Arrays/MultiLineArrayUnitTest.php | 4 ++-- MO4/Tests/Commenting/PropertyCommentUnitTest.php | 4 ++-- .../Formatting/UnnecessaryNamespaceUsageUnitTest.php | 4 ++-- .../Strings/VariableInDoubleQuotedStringUnitTest.php | 4 ++-- MO4/Tests/WhiteSpace/ConstantSpacingUnitTest.php | 4 ++-- MO4/Tests/WhiteSpace/MultipleEmptyLinesUnitTest.php | 4 ++-- composer.json | 3 +-- phpunit.xml.dist | 7 ++++--- 12 files changed, 25 insertions(+), 24 deletions(-) rename MO4/Tests/{AbstractMo4SniffUnitTest.php => AbstractMo4SniffUnitTestCase.php} (97%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e1a7fb..a02fe65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,10 +97,10 @@ jobs: if: ${{ matrix.os == 'windows-latest' && matrix.php_version != '8.1' && matrix.php_version != '8.2' }} run: vendor/bin/phan --allow-polyfill-parser - name: Run tests with coverage - if: ${{ matrix.os != 'windows-latest' && matrix.php_version == '8.1' && matrix.dependencies_level != '--prefer-lowest' }} + if: ${{ matrix.os != 'windows-latest' && matrix.php_version == '8.4' && matrix.dependencies_level != '--prefer-lowest' }} run: php vendor/bin/phpunit --coverage-clover=coverage.xml --coverage-cobertura=cobertura.xml --log-junit=junit.xml - name: Upload coverage to Codecov - if: ${{ matrix.os != 'windows-latest' && matrix.php_version == '8.1' && matrix.dependencies_level != '--prefer-lowest' }} + if: ${{ matrix.os != 'windows-latest' && matrix.php_version == '8.4' && matrix.dependencies_level != '--prefer-lowest' }} uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -108,7 +108,7 @@ jobs: disable_search: true files: ./coverage.xml - name: Upload test results to Codecov - if: ${{ matrix.os != 'windows-latest' && matrix.php_version == '8.1' && matrix.dependencies_level != '--prefer-lowest' }} + if: ${{ matrix.os != 'windows-latest' && matrix.php_version == '8.4' && matrix.dependencies_level != '--prefer-lowest' }} uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -116,7 +116,7 @@ jobs: disable_search: true files: ./junit.xml - name: Upload coverage to Qlty - if: ${{ matrix.os != 'windows-latest' && matrix.php_version == '8.1' && matrix.dependencies_level != '--prefer-lowest' }} + if: ${{ matrix.os != 'windows-latest' && matrix.php_version == '8.4' && matrix.dependencies_level != '--prefer-lowest' }} uses: qltysh/qlty-action/coverage@fd52dc852530a708d68c3b7342f8d33d1df4cd55 # v2.2.1 with: token: ${{ secrets.QLTY_COVERAGE_TOKEN }} diff --git a/.gitignore b/.gitignore index 50ece6c..662071b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ composer.lock /build/ .atoum.php phpunit.xml +.phpunit.cache .phpunit.result.cache behat.yml diff --git a/MO4/Tests/AbstractMo4SniffUnitTest.php b/MO4/Tests/AbstractMo4SniffUnitTestCase.php similarity index 97% rename from MO4/Tests/AbstractMo4SniffUnitTest.php rename to MO4/Tests/AbstractMo4SniffUnitTestCase.php index 0c3c924..805dabf 100644 --- a/MO4/Tests/AbstractMo4SniffUnitTest.php +++ b/MO4/Tests/AbstractMo4SniffUnitTestCase.php @@ -34,7 +34,7 @@ * * @link https://github.com/mayflower/mo4-coding-standard */ -abstract class AbstractMo4SniffUnitTest extends AbstractSniffTestCase +abstract class AbstractMo4SniffUnitTestCase extends AbstractSniffTestCase { /** * Array or Array containing the test file as key and as value the key-value pairs with line number and number of# diff --git a/MO4/Tests/Arrays/ArrayDoubleArrowAlignmentUnitTest.php b/MO4/Tests/Arrays/ArrayDoubleArrowAlignmentUnitTest.php index 78ecf0a..a960362 100644 --- a/MO4/Tests/Arrays/ArrayDoubleArrowAlignmentUnitTest.php +++ b/MO4/Tests/Arrays/ArrayDoubleArrowAlignmentUnitTest.php @@ -14,7 +14,7 @@ namespace MO4\Tests\Arrays; -use MO4\Tests\AbstractMo4SniffUnitTest; +use MO4\Tests\AbstractMo4SniffUnitTestCase; /** * Unit test class for @see ArrayDoubleArrowAlignmentSniff @@ -30,7 +30,7 @@ * * @link https://github.com/mayflower/mo4-coding-standard */ -final class ArrayDoubleArrowAlignmentUnitTest extends AbstractMo4SniffUnitTest +final class ArrayDoubleArrowAlignmentUnitTest extends AbstractMo4SniffUnitTestCase { protected $expectedErrorList = [ 'ArrayDoubleArrowAlignmentUnitTest.pass.inc' => [], diff --git a/MO4/Tests/Arrays/MultiLineArrayUnitTest.php b/MO4/Tests/Arrays/MultiLineArrayUnitTest.php index 711aaaa..29aa797 100644 --- a/MO4/Tests/Arrays/MultiLineArrayUnitTest.php +++ b/MO4/Tests/Arrays/MultiLineArrayUnitTest.php @@ -14,7 +14,7 @@ namespace MO4\Tests\Arrays; -use MO4\Tests\AbstractMo4SniffUnitTest; +use MO4\Tests\AbstractMo4SniffUnitTestCase; /** * Unit test class for @see MultiLineArraySniff @@ -30,7 +30,7 @@ * * @link https://github.com/mayflower/mo4-coding-standard */ -final class MultiLineArrayUnitTest extends AbstractMo4SniffUnitTest +final class MultiLineArrayUnitTest extends AbstractMo4SniffUnitTestCase { protected $expectedErrorList = [ 'MultiLineArrayUnitTest.pass.inc' => [], diff --git a/MO4/Tests/Commenting/PropertyCommentUnitTest.php b/MO4/Tests/Commenting/PropertyCommentUnitTest.php index 06f3c91..23e1570 100644 --- a/MO4/Tests/Commenting/PropertyCommentUnitTest.php +++ b/MO4/Tests/Commenting/PropertyCommentUnitTest.php @@ -14,7 +14,7 @@ namespace MO4\Tests\Commenting; -use MO4\Tests\AbstractMo4SniffUnitTest; +use MO4\Tests\AbstractMo4SniffUnitTestCase; /** * Unit test class for the PropertyComment sniff. @@ -30,7 +30,7 @@ * * @link https://github.com/mayflower/mo4-coding-standard */ -final class PropertyCommentUnitTest extends AbstractMo4SniffUnitTest +final class PropertyCommentUnitTest extends AbstractMo4SniffUnitTestCase { protected $expectedErrorList = [ 'PropertyCommentUnitTest.pass.inc' => [], diff --git a/MO4/Tests/Formatting/UnnecessaryNamespaceUsageUnitTest.php b/MO4/Tests/Formatting/UnnecessaryNamespaceUsageUnitTest.php index a811f1c..87016ae 100644 --- a/MO4/Tests/Formatting/UnnecessaryNamespaceUsageUnitTest.php +++ b/MO4/Tests/Formatting/UnnecessaryNamespaceUsageUnitTest.php @@ -14,7 +14,7 @@ namespace MO4\Tests\Formatting; -use MO4\Tests\AbstractMo4SniffUnitTest; +use MO4\Tests\AbstractMo4SniffUnitTestCase; /** * Unit test class for the UnnecessaryNamespaceUsageUnitTest sniff. @@ -32,7 +32,7 @@ * * @link https://github.com/mayflower/mo4-coding-standard */ -final class UnnecessaryNamespaceUsageUnitTest extends AbstractMo4SniffUnitTest +final class UnnecessaryNamespaceUsageUnitTest extends AbstractMo4SniffUnitTestCase { protected $expectedWarningList = [ 'UnnecessaryNamespaceUsageUnitTest.pass.1.inc' => [], diff --git a/MO4/Tests/Strings/VariableInDoubleQuotedStringUnitTest.php b/MO4/Tests/Strings/VariableInDoubleQuotedStringUnitTest.php index 0c6e770..8629f58 100644 --- a/MO4/Tests/Strings/VariableInDoubleQuotedStringUnitTest.php +++ b/MO4/Tests/Strings/VariableInDoubleQuotedStringUnitTest.php @@ -14,7 +14,7 @@ namespace MO4\Tests\Strings; -use MO4\Tests\AbstractMo4SniffUnitTest; +use MO4\Tests\AbstractMo4SniffUnitTestCase; /** * Unit test class for the VariableInDoubleQuotedString sniff. @@ -30,7 +30,7 @@ * * @link https://github.com/mayflower/mo4-coding-standard */ -final class VariableInDoubleQuotedStringUnitTest extends AbstractMo4SniffUnitTest +final class VariableInDoubleQuotedStringUnitTest extends AbstractMo4SniffUnitTestCase { protected $expectedErrorList = [ 'VariableInDoubleQuotedStringUnitTest.pass.inc' => [], diff --git a/MO4/Tests/WhiteSpace/ConstantSpacingUnitTest.php b/MO4/Tests/WhiteSpace/ConstantSpacingUnitTest.php index a4f52b6..f231581 100644 --- a/MO4/Tests/WhiteSpace/ConstantSpacingUnitTest.php +++ b/MO4/Tests/WhiteSpace/ConstantSpacingUnitTest.php @@ -14,7 +14,7 @@ namespace MO4\Tests\WhiteSpace; -use MO4\Tests\AbstractMo4SniffUnitTest; +use MO4\Tests\AbstractMo4SniffUnitTestCase; /** * Unit test class for the VariableInDoubleQuotedString sniff. @@ -30,7 +30,7 @@ * * @link https://github.com/mayflower/mo4-coding-standard */ -final class ConstantSpacingUnitTest extends AbstractMo4SniffUnitTest +final class ConstantSpacingUnitTest extends AbstractMo4SniffUnitTestCase { protected $expectedErrorList = [ 'ConstantSpacingUnitTest.pass.inc' => [], diff --git a/MO4/Tests/WhiteSpace/MultipleEmptyLinesUnitTest.php b/MO4/Tests/WhiteSpace/MultipleEmptyLinesUnitTest.php index 13703b4..6d6c0df 100644 --- a/MO4/Tests/WhiteSpace/MultipleEmptyLinesUnitTest.php +++ b/MO4/Tests/WhiteSpace/MultipleEmptyLinesUnitTest.php @@ -14,7 +14,7 @@ namespace MO4\Tests\WhiteSpace; -use MO4\Tests\AbstractMo4SniffUnitTest; +use MO4\Tests\AbstractMo4SniffUnitTestCase; /** * Unit test class for the MultipleEmptyLines sniff. @@ -30,7 +30,7 @@ * * @link https://github.com/mayflower/mo4-coding-standard */ -final class MultipleEmptyLinesUnitTest extends AbstractMo4SniffUnitTest +final class MultipleEmptyLinesUnitTest extends AbstractMo4SniffUnitTestCase { protected $expectedErrorList = [ 'MultipleEmptyLinesUnitTest.pass.inc' => [], diff --git a/composer.json b/composer.json index 51843e5..f36b576 100644 --- a/composer.json +++ b/composer.json @@ -31,11 +31,10 @@ }, "require-dev": { "ergebnis/composer-normalize": "^2.45", - "nikic/php-parser": "< 5.0.1", "phan/phan": "^6.0.0", "phpstan/phpstan": "^2.0", "phpstan/phpstan-strict-rules": "^2.0", - "phpunit/phpunit": "> 9.6.15 < 9.6.33", + "phpunit/phpunit": "^10.5.62 || ^11.5.51", "psalm/plugin-phpunit": "^0.19", "sabre/event": ">= 5.1.6", "symfony/filesystem": ">= 5.4.45", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 312cde8..dd56fe2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,19 +1,20 @@ MO4/Tests - + ./MO4/Sniffs - +