From dd02c2b9f656c26221fc4f828eb9535f6341f6f5 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 14 Oct 2025 17:51:14 +0700 Subject: [PATCH 1/3] Add test PHPUnit 10 with PHP-Parser 4 usage --- .github/workflows/compat_tests.yaml.yml | 4 ++++ composer.json | 2 +- tests/UsePHPParser4Test.php | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/UsePHPParser4Test.php diff --git a/.github/workflows/compat_tests.yaml.yml b/.github/workflows/compat_tests.yaml.yml index 6a74a46..f629470 100644 --- a/.github/workflows/compat_tests.yaml.yml +++ b/.github/workflows/compat_tests.yaml.yml @@ -12,6 +12,10 @@ jobs: fail-fast: false matrix: actions: + - + name: 'Rector dev + PHPUnit 10' + run: composer require "phpunit/phpunit:10.*" -W + php: 8.2 - name: 'Rector dev + PHPUnit 11' run: composer require "phpunit/phpunit:11.*" -W diff --git a/composer.json b/composer.json index 234082d..1aa3e32 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Tests for compatibility with PHPStand and PHPUnit preload magic", "require-dev": { "php": "^8.2", - "phpunit/phpunit": "11.*|12.*", + "phpunit/phpunit": "10.*|11.*|12.*", "rector/rector": "dev-main", "phpstan/phpstan": "^2.1" }, diff --git a/tests/UsePHPParser4Test.php b/tests/UsePHPParser4Test.php new file mode 100644 index 0000000..52a230b --- /dev/null +++ b/tests/UsePHPParser4Test.php @@ -0,0 +1,21 @@ += 11) { + $this->markTestSkipped('Only for PHPUnit 11+'); + } + + // this uses nikic/php-parser v4 parser + (new \PhpParser\ParserFactory())->create(\PhpParser\ParserFactory::PREFER_PHP7); + + $this->assertTrue(true); + } +} \ No newline at end of file From 25c6b0aadbe7f2912333599f8190555cf00642e6 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 14 Oct 2025 17:53:13 +0700 Subject: [PATCH 2/3] nikic-php-parser4 --- .github/workflows/compat_tests.yaml.yml | 2 +- composer.json | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compat_tests.yaml.yml b/.github/workflows/compat_tests.yaml.yml index f629470..59a4ff2 100644 --- a/.github/workflows/compat_tests.yaml.yml +++ b/.github/workflows/compat_tests.yaml.yml @@ -14,7 +14,7 @@ jobs: actions: - name: 'Rector dev + PHPUnit 10' - run: composer require "phpunit/phpunit:10.*" -W + run: composer require "phpunit/phpunit:10.*" "nikic/php-parser:4.*" -W php: 8.2 - name: 'Rector dev + PHPUnit 11' diff --git a/composer.json b/composer.json index 1aa3e32..0cdbfe1 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,6 @@ "description": "Tests for compatibility with PHPStand and PHPUnit preload magic", "require-dev": { "php": "^8.2", - "phpunit/phpunit": "10.*|11.*|12.*", "rector/rector": "dev-main", "phpstan/phpstan": "^2.1" }, @@ -16,5 +15,8 @@ "psr-4": { "Rector\\RectorCompatTests\\Tests\\": "tests" } + }, + "require": { + "phpunit/phpunit": "10.*" } } From 750b563e0247315a9fae73539e5efd8b10594341 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 14 Oct 2025 17:54:38 +0700 Subject: [PATCH 3/3] dep --- composer.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 0cdbfe1..1aa3e32 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,7 @@ "description": "Tests for compatibility with PHPStand and PHPUnit preload magic", "require-dev": { "php": "^8.2", + "phpunit/phpunit": "10.*|11.*|12.*", "rector/rector": "dev-main", "phpstan/phpstan": "^2.1" }, @@ -15,8 +16,5 @@ "psr-4": { "Rector\\RectorCompatTests\\Tests\\": "tests" } - }, - "require": { - "phpunit/phpunit": "10.*" } }