Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/compat_tests.yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
fail-fast: false
matrix:
actions:
-
name: 'Rector dev + PHPUnit 10'
run: composer require "phpunit/phpunit:10.*" "nikic/php-parser:4.*" -W
php: 8.2
-
name: 'Rector dev + PHPUnit 11'
run: composer require "phpunit/phpunit:11.*" -W
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
21 changes: 21 additions & 0 deletions tests/UsePHPParser4Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Rector\RectorCompatTests\Tests\Rector\MakeClassFinalRector;

use PHPUnit\Framework\TestCase;
use PHPUnit\Runner\Version;

final class UsePHPParser4Test extends TestCase
{
public function test(): void
{
if ((int) Version::id() >= 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);
}
}
Loading